diff --git a/ChangeLog b/ChangeLog index 0abf8377e1..e6171234c1 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +Tue Apr 23 14:04:44 2013 Shugo Maeda + + * lib/net/imap.rb (getacl_response): parse the mailbox of an ACL + response correctly. [ruby-core:54365] [Bug #8281] + Tue Apr 23 11:58:46 2013 Nobuyoshi Nakada * string.c (rb_str_scrub): fix for UTF-32. strlen() on strings diff --git a/lib/net/imap.rb b/lib/net/imap.rb index f68fe4551e..a816b4e263 100644 --- a/lib/net/imap.rb +++ b/lib/net/imap.rb @@ -1740,7 +1740,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. # @@ -2806,6 +2806,7 @@ module Net token = match(T_ATOM) name = token.value.upcase match(T_SPACE) + mailbox = astring data = [] token = lookahead if token.symbol == T_SPACE @@ -2821,8 +2822,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 4062e1b9e7..c329f4285f 100644 --- a/test/net/imap/test_imap_response_parser.rb +++ b/test/net/imap/test_imap_response_parser.rb @@ -223,4 +223,18 @@ EOF assert_equal("7BIT", delivery_status.encoding) assert_equal(410, delivery_status.size) end + + # [Bug #8281] + def test_acl + parser = Net::IMAP::ResponseParser.new + response = parser.parse(<