Project

General

Profile

Backport #8281

Net::IMAP can't parse response to the IMAP SETACL command correctly

Added by adantel (Alex Filatau) over 6 years ago. Updated over 6 years ago.

Status:
Closed
Priority:
Normal
[ruby-core:54365]

Description

Found in ruby-2.0.0-p0

I'm working right now on upgrade of our test system from ruby 1.9.2 to ruby 2.0.0. Unfortunately, one of the test scripts that works flawlessly with ruby 1.9.2 is failing when trying to parse response of GETACL command. See the debug of the session below:

C: RUBY0002 CREATE INBOX/share
S: RUBY0002 OK CREATE completed
C: RUBY0003 SETACL INBOX/share imshare1copy1366146467@xxxxxxxxxxxxxxxxxx.com lrswickxteda
S: RUBY0003 OK SETACL completed
C: RUBY0004 GETACL INBOX/share
S: * ACL "INBOX/share" "imshare2copy1366146467@xxxxxxxxxxxxxxxxxx.com" lrswickxteda "imshare1copy1366146467@xxxxxxxxxxxxxxxxxx.com" lrswickxteda
@str: "* ACL \"INBOX/share\" \"imshare2copy1366146467@xxxxxxxxxxxxxxxxxx.com\" lrswickxteda \"imshare1copy1366146467@xxxxxxxxxxxxxxxxxx.com\" lrswickxteda\r\n"
@pos: 19
@lex_state: EXPR_BEG
@token.symbol: QUOTED
@token.value: "INBOX/share"
#
/usr/local/rvm/rubies/ruby-2.0.0-p0/lib/ruby/2.0.0/net/imap.rb:3363:in parse_error'
/usr/local/rvm/rubies/ruby-2.0.0-p0/lib/ruby/2.0.0/net/imap.rb:3215:in
match'
/usr/local/rvm/rubies/ruby-2.0.0-p0/lib/ruby/2.0.0/net/imap.rb:2136:in response'
/usr/local/rvm/rubies/ruby-2.0.0-p0/lib/ruby/2.0.0/net/imap.rb:2058:in
parse'
/usr/local/rvm/rubies/ruby-2.0.0-p0/lib/ruby/2.0.0/net/imap.rb:1181:in get_response'
/usr/local/rvm/rubies/ruby-2.0.0-p0/lib/ruby/2.0.0/net/imap.rb:1089:in
receive_responses'
/usr/local/rvm/rubies/ruby-2.0.0-p0/lib/ruby/2.0.0/net/imap.rb:1075:in `block in initialize'

Please note, the same piece is working fine with ruby 1.9.2

Associated revisions

Revision 8541ed6d
Added by shugo (Shugo Maeda) over 6 years ago

  • 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

Revision 40419
Added by shugo (Shugo Maeda) over 6 years ago

  • lib/net/imap.rb (getacl_response): parse the mailbox of an ACL response correctly. [ruby-core:54365] [Bug #8281]

Revision 40419
Added by shugo (Shugo Maeda) over 6 years ago

  • lib/net/imap.rb (getacl_response): parse the mailbox of an ACL response correctly. [ruby-core:54365] [Bug #8281]

Revision 40419
Added by shugo (Shugo Maeda) over 6 years ago

  • lib/net/imap.rb (getacl_response): parse the mailbox of an ACL response correctly. [ruby-core:54365] [Bug #8281]

Revision 40419
Added by shugo (Shugo Maeda) over 6 years ago

  • lib/net/imap.rb (getacl_response): parse the mailbox of an ACL response correctly. [ruby-core:54365] [Bug #8281]

Revision 40419
Added by shugo (Shugo Maeda) over 6 years ago

  • lib/net/imap.rb (getacl_response): parse the mailbox of an ACL response correctly. [ruby-core:54365] [Bug #8281]

Revision 40419
Added by shugo (Shugo Maeda) over 6 years ago

  • lib/net/imap.rb (getacl_response): parse the mailbox of an ACL response correctly. [ruby-core:54365] [Bug #8281]

Revision 96de351e
Added by nagachika (Tomoyuki Chikanaga) over 6 years ago

merge revision(s) 40419: [Backport #8281]

    * 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/branches/ruby_2_0_0@40426 b2dd03c8-39d4-4d8f-98ff-823fe69b080e

Revision 2bfe339a
Added by usa (Usaku NAKAMURA) over 6 years ago

merge revision(s) 40419: [Backport #8281]

    * 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/branches/ruby_1_9_3@40718 b2dd03c8-39d4-4d8f-98ff-823fe69b080e

Revision 40718
Added by usa (Usaku NAKAMURA) over 6 years ago

merge revision(s) 40419: [Backport #8281]

* lib/net/imap.rb (getacl_response): parse the mailbox of an ACL
  response correctly.  [ruby-core:54365] [Bug #8281]

History

Updated by adantel (Alex Filatau) over 6 years ago

It looks like the problem is in method getacl_response. Someone removed "mailbox = astring" line from there dot fixing the consequences. Returning this line back makes code happy and the response_untagged gets correct Net::IMAP::UntaggedResponse with non empty data attribute for ACL commands.

That's the in fact done in the following commit https://github.com/ruby/ruby/commit/f3e35474078895e1d178e15cfbfc6743f9ffc62d#lib/net/imap.rb
mailbox variable is not used indeed, but the astring is doing one lookahead call, that shifts focus to the next token, and that's expected by future code.

Updated by shugo (Shugo Maeda) over 6 years ago

  • Status changed from Open to Assigned
  • Assignee set to shugo (Shugo Maeda)
#3

Updated by shugo (Shugo Maeda) over 6 years ago

  • Status changed from Assigned to Closed
  • % Done changed from 0 to 100

This issue was solved with changeset r40419.
Alex, thank you for reporting this issue.
Your contribution to Ruby is greatly appreciated.
May Ruby be with you.


  • lib/net/imap.rb (getacl_response): parse the mailbox of an ACL response correctly. [ruby-core:54365] [Bug #8281]
#4

Updated by nagachika (Tomoyuki Chikanaga) over 6 years ago

  • Tracker changed from Bug to Backport
  • Project changed from Ruby master to Backport200
  • Status changed from Closed to Assigned
  • Assignee changed from shugo (Shugo Maeda) to nagachika (Tomoyuki Chikanaga)
#5

Updated by nagachika (Tomoyuki Chikanaga) over 6 years ago

  • Status changed from Assigned to Closed

This issue was solved with changeset r40426.
Alex, thank you for reporting this issue.
Your contribution to Ruby is greatly appreciated.
May Ruby be with you.


merge revision(s) 40419: [Backport #8281]

* lib/net/imap.rb (getacl_response): parse the mailbox of an ACL
  response correctly.  [ruby-core:54365] [Bug #8281]
#6

Updated by nagachika (Tomoyuki Chikanaga) over 6 years ago

  • Project changed from Backport200 to Backport193
  • Status changed from Closed to Assigned

Updated by nagachika (Tomoyuki Chikanaga) over 6 years ago

  • Assignee changed from nagachika (Tomoyuki Chikanaga) to usa (Usaku NAKAMURA)
#8

Updated by usa (Usaku NAKAMURA) over 6 years ago

  • Status changed from Assigned to Closed

This issue was solved with changeset r40718.
Alex, thank you for reporting this issue.
Your contribution to Ruby is greatly appreciated.
May Ruby be with you.


merge revision(s) 40419: [Backport #8281]

* lib/net/imap.rb (getacl_response): parse the mailbox of an ACL
  response correctly.  [ruby-core:54365] [Bug #8281]

Also available in: Atom PDF