mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
* lib/net/imap.rb (getacl_response): parse the mailbox of an ACL
response correctly. [ruby-core:54365] [Bug #8281] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@40419 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
3ae96e8c6b
commit
8541ed6df6
3 changed files with 22 additions and 3 deletions
|
@ -1,3 +1,8 @@
|
||||||
|
Tue Apr 23 14:04:44 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 Apr 23 11:58:46 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
|
Tue Apr 23 11:58:46 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
|
||||||
|
|
||||||
* string.c (rb_str_scrub): fix for UTF-32. strlen() on strings
|
* string.c (rb_str_scrub): fix for UTF-32. strlen() on strings
|
||||||
|
|
|
@ -1740,7 +1740,7 @@ module Net
|
||||||
# rights:: The access rights the indicated user has to the
|
# rights:: The access rights the indicated user has to the
|
||||||
# mailbox.
|
# mailbox.
|
||||||
#
|
#
|
||||||
MailboxACLItem = Struct.new(:user, :rights)
|
MailboxACLItem = Struct.new(:user, :rights, :mailbox)
|
||||||
|
|
||||||
# Net::IMAP::StatusData represents contents of the STATUS response.
|
# Net::IMAP::StatusData represents contents of the STATUS response.
|
||||||
#
|
#
|
||||||
|
@ -2806,6 +2806,7 @@ module Net
|
||||||
token = match(T_ATOM)
|
token = match(T_ATOM)
|
||||||
name = token.value.upcase
|
name = token.value.upcase
|
||||||
match(T_SPACE)
|
match(T_SPACE)
|
||||||
|
mailbox = astring
|
||||||
data = []
|
data = []
|
||||||
token = lookahead
|
token = lookahead
|
||||||
if token.symbol == T_SPACE
|
if token.symbol == T_SPACE
|
||||||
|
@ -2821,8 +2822,7 @@ module Net
|
||||||
user = astring
|
user = astring
|
||||||
match(T_SPACE)
|
match(T_SPACE)
|
||||||
rights = astring
|
rights = astring
|
||||||
##XXX data.push([user, rights])
|
data.push(MailboxACLItem.new(user, rights, mailbox))
|
||||||
data.push(MailboxACLItem.new(user, rights))
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
return UntaggedResponse.new(name, data, @str)
|
return UntaggedResponse.new(name, data, @str)
|
||||||
|
|
|
@ -223,4 +223,18 @@ EOF
|
||||||
assert_equal("7BIT", delivery_status.encoding)
|
assert_equal("7BIT", delivery_status.encoding)
|
||||||
assert_equal(410, delivery_status.size)
|
assert_equal(410, delivery_status.size)
|
||||||
end
|
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
|
end
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue