diff --git a/ChangeLog b/ChangeLog index 02b318d50c..63b10e0cb2 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +Tue Apr 23 22:33:16 2013 Shugo Maeda + + * lib/net/imap.rb (getacl_response): parse the mailbox of an ACL + response correctly. [ruby-core:54365] [Bug #8281] + Sun Apr 21 00:14:36 2013 Kazuhiro NISHIYAMA * test/ruby/test_require.rb (TestRequire#test_require_nonascii_path): diff --git a/lib/net/imap.rb b/lib/net/imap.rb index a83f455163..50548f138f 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. # @@ -2807,6 +2807,7 @@ module Net token = match(T_ATOM) name = token.value.upcase match(T_SPACE) + mailbox = astring data = [] token = lookahead if token.symbol == T_SPACE @@ -2822,8 +2823,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 2dc5f0ce4b..ee27a1271e 100644 --- a/test/net/imap/test_imap_response_parser.rb +++ b/test/net/imap/test_imap_response_parser.rb @@ -180,4 +180,18 @@ EOF * 1038 FETCH (BODY ("MIXED")) EOF end + + # [Bug #8281] + def test_acl + parser = Net::IMAP::ResponseParser.new + response = parser.parse(<