diff options
-rw-r--r-- | ChangeLog | 5 | ||||
-rw-r--r-- | lib/net/imap.rb | 6 | ||||
-rw-r--r-- | test/net/imap/test_imap_response_parser.rb | 14 | ||||
-rw-r--r-- | version.h | 2 |
4 files changed, 23 insertions, 4 deletions
@@ -1,3 +1,8 @@ +Tue Apr 23 22:33:16 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] + Sun Apr 21 00:14:36 2013 Kazuhiro NISHIYAMA <zn@mbf.nifty.com> * 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(<<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 @@ -1,6 +1,6 @@ #define RUBY_VERSION "2.0.0" #define RUBY_RELEASE_DATE "2013-04-23" -#define RUBY_PATCHLEVEL 161 +#define RUBY_PATCHLEVEL 162 #define RUBY_RELEASE_YEAR 2013 #define RUBY_RELEASE_MONTH 4 |