summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog5
-rw-r--r--lib/net/imap.rb6
-rw-r--r--test/net/imap/test_imap_response_parser.rb14
-rw-r--r--version.h2
4 files changed, 23 insertions, 4 deletions
diff --git a/ChangeLog b/ChangeLog
index bbcdfdab22..a433a9bec5 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+Tue May 14 11:36:22 2013 Shugo Maeda <shugo@ruby-lang.org>
+
+ * lib/net/imap.rb (getacl_response): parse the mailbox of an ACL
+ response correctly. [ruby-core:54365] [Bug #8281]
+
Tue May 14 11:24:22 2013 Martin Bosslet <Martin.Bosslet@gmail.com>
* ext/openssl/ossl_ssl.c: Correct shutdown behavior w.r.t GC.
diff --git a/lib/net/imap.rb b/lib/net/imap.rb
index e0815a1892..794e82328e 100644
--- a/lib/net/imap.rb
+++ b/lib/net/imap.rb
@@ -1725,7 +1725,7 @@ module Net
# rights:: The access rights the indicated user has to the
# mailbox.
#
- MailboxACLItem = Struct.new(:user, :rights)
+ MailboxACLItem = Struct.new(:user, :rights, :mailbox)
# Net::IMAP::StatusData represents contents of the STATUS response.
#
@@ -2722,6 +2722,7 @@ module Net
token = match(T_ATOM)
name = token.value.upcase
match(T_SPACE)
+ mailbox = astring
data = []
token = lookahead
if token.symbol == T_SPACE
@@ -2737,8 +2738,7 @@ module Net
user = astring
match(T_SPACE)
rights = astring
- ##XXX data.push([user, rights])
- data.push(MailboxACLItem.new(user, rights))
+ data.push(MailboxACLItem.new(user, rights, mailbox))
end
end
return UntaggedResponse.new(name, data, @str)
diff --git a/test/net/imap/test_imap_response_parser.rb b/test/net/imap/test_imap_response_parser.rb
index 6a5a117408..d1bda45d84 100644
--- a/test/net/imap/test_imap_response_parser.rb
+++ b/test/net/imap/test_imap_response_parser.rb
@@ -116,4 +116,18 @@ EOF
* 1 FETCH (UID 92285 )
EOF
end
+
+ # [Bug #8281]
+ def test_acl
+ parser = Net::IMAP::ResponseParser.new
+ response = parser.parse(<<EOF.gsub(/\n/, "\r\n").taint)
+* ACL "INBOX/share" "imshare2copy1366146467@xxxxxxxxxxxxxxxxxx.com" lrswickxteda
+EOF
+ assert_equal("ACL", response.name)
+ assert_equal(1, response.data.length)
+ assert_equal("INBOX/share", response.data[0].mailbox)
+ assert_equal("imshare2copy1366146467@xxxxxxxxxxxxxxxxxx.com",
+ response.data[0].user)
+ assert_equal("lrswickxteda", response.data[0].rights)
+ end
end
diff --git a/version.h b/version.h
index b290241013..aebab43854 100644
--- a/version.h
+++ b/version.h
@@ -1,5 +1,5 @@
#define RUBY_VERSION "1.9.3"
-#define RUBY_PATCHLEVEL 421
+#define RUBY_PATCHLEVEL 422
#define RUBY_RELEASE_DATE "2013-05-14"
#define RUBY_RELEASE_YEAR 2013