GNU bug report logs - #1173
gnus/imap.el should quote quotes in password

Previous Next

Package: emacs;

Reported by: "Aaron D. Ball" <adb <at> broad.mit.edu>

Date: Wed, 15 Oct 2008 18:20:03 UTC

Severity: normal

Done: Chong Yidong <cyd <at> stupidchicken.com>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 1173 in the body.
You can then email your comments to 1173 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-submit-list <at> lists.donarmstrong.com, Emacs Bugs <bug-gnu-emacs <at> gnu.org>:
bug#1173; Package emacs. Full text and rfc822 format available.

Acknowledgement sent to "Aaron D. Ball" <adb <at> broad.mit.edu>:
New bug report received and forwarded. Copy sent to Emacs Bugs <bug-gnu-emacs <at> gnu.org>. Full text and rfc822 format available.

Message #5 received at submit <at> emacsbugs.donarmstrong.com (full text, mbox):

From: "Aaron D. Ball" <adb <at> broad.mit.edu>
To: bug-gnu-emacs <at> gnu.org
Subject: gnus/imap.el should quote quotes in password
Date: Wed, 15 Oct 2008 14:11:43 -0400
When sending a LOGIN command, the imap-login-auth function in imap.el 
does not quote double quotes in the password string, so passwords 
containing double quotes result in an error.

I'm using stock Emacs 22.3, compiled by our sysadmin team here:

GNU Emacs 22.3.2 (x86_64-unknown-linux-gnu, X toolkit, Xaw3d scroll 
bars) of 2008-09-26 on node106

Below is the patch I am using, which fixed the problem for me:

--- lisp/gnus/imap.el~      2008-01-06 20:22:42.000000000 -0500
+++ lisp/gnus/imap.el       2008-10-15 13:58:06.124586000 -0400
@@ -922,7 +922,7 @@
                          (lambda (user passwd)
                            (imap-ok-p (imap-send-command-wait
                                        (concat "LOGIN \"" user "\" \""
-                                               passwd "\""))))))
+ 
(replace-regexp-in-string "\"" "\\\"" passwd) "\""))))))

 (defun imap-anonymous-p (buffer)
   t)

-- 
Aaron D. Ball <adb <at> broad.mit.edu>
Senior Systems Analyst
Broad Institute of MIT and Harvard





Information forwarded to bug-submit-list <at> lists.donarmstrong.com, Emacs Bugs <bug-gnu-emacs <at> gnu.org>:
bug#1173; Package emacs. Full text and rfc822 format available.

Acknowledgement sent to "Aaron D. Ball" <adb <at> broad.mit.edu>:
Extra info received and forwarded to list. Copy sent to Emacs Bugs <bug-gnu-emacs <at> gnu.org>. Full text and rfc822 format available.

Message #10 received at 1173 <at> emacsbugs.donarmstrong.com (full text, mbox):

From: "Aaron D. Ball" <adb <at> broad.mit.edu>
To: 1173 <at> debbugs.gnu.org
Subject: Re: bug#1173: Acknowledgement (gnus/imap.el should quote quotes in
  password)
Date: Wed, 15 Oct 2008 14:43:05 -0400
I was mistaken about that patch fixing the problem.  It had a syntax 
error, so I didn't get the IMAP server error message, just an Emacs 
error message that went by fast enough that I missed it.

If someone can provide a patch that (unlike mine) actually works, I'd 
appreciate that.  In the meantime I'll see if I can figure out elisp 
string replacement again---it's been a while.

-- 
Aaron D. Ball <adb <at> broad.mit.edu>
Senior Systems Analyst
Broad Institute of MIT and Harvard




Information forwarded to bug-submit-list <at> lists.donarmstrong.com, Emacs Bugs <bug-gnu-emacs <at> gnu.org>:
bug#1173; Package emacs. Full text and rfc822 format available.

Acknowledgement sent to "Aaron D. Ball" <adb <at> broad.mit.edu>:
Extra info received and forwarded to list. Copy sent to Emacs Bugs <bug-gnu-emacs <at> gnu.org>. Full text and rfc822 format available.

Message #15 received at 1173 <at> emacsbugs.donarmstrong.com (full text, mbox):

From: "Aaron D. Ball" <adb <at> broad.mit.edu>
To: 1173 <at> debbugs.gnu.org
Subject: Re: bug#1173: Acknowledgement (gnus/imap.el should quote quotes in
  password)
Date: Wed, 15 Oct 2008 15:00:22 -0400
Looks like all I needed was to specify that the replacement is literal. 
 This patch let me read my mail for real.

--- lisp/gnus/imap.el~  2008-01-06 20:22:42.000000000 -0500
+++ lisp/gnus/imap.el   2008-10-15 14:58:40.890800000 -0400
@@ -922,7 +922,7 @@
                          (lambda (user passwd)
                            (imap-ok-p (imap-send-command-wait
                                        (concat "LOGIN \"" user "\" \""
-                                               passwd "\""))))))
+ 
(replace-regexp-in-string "\"" "\\\"" passwd t t) "\""))))))

 (defun imap-anonymous-p (buffer)
   t)


-- 
Aaron D. Ball <adb <at> broad.mit.edu>
Senior Systems Analyst
Broad Institute of MIT and Harvard




Information forwarded to bug-submit-list <at> lists.donarmstrong.com, Emacs Bugs <bug-gnu-emacs <at> gnu.org>:
bug#1173; Package emacs. Full text and rfc822 format available.

Message #18 received at 1173 <at> emacsbugs.donarmstrong.com (full text, mbox):

From: Ted Zlatanov <tzz <at> lifelogs.com>
To: bug-gnu-emacs <at> gnu.org
Subject: Re: bug#1173: Acknowledgement (gnus/imap.el should quote quotes in
	password)
Date: Thu, 16 Oct 2008 11:16:00 -0500
The following message is a courtesy copy of an article
that has been posted to gnu.emacs.bug as well.

On Wed, 15 Oct 2008 15:00:22 -0400 "Aaron D. Ball" <adb <at> broad.mit.edu> wrote: 

ADB> Looks like all I needed was to specify that the replacement is
ADB> literal. This patch let me read my mail for real.

ADB> --- lisp/gnus/imap.el~  2008-01-06 20:22:42.000000000 -0500
ADB> +++ lisp/gnus/imap.el   2008-10-15 14:58:40.890800000 -0400
ADB> @@ -922,7 +922,7 @@
ADB>                           (lambda (user passwd)
ADB>                             (imap-ok-p (imap-send-command-wait
ADB>                                         (concat "LOGIN \"" user "\" \""
ADB> -                                               passwd "\""))))))
ADB> + (replace-regexp-in-string "\"" "\\\"" passwd t t) "\""))))))

ADB>  (defun imap-anonymous-p (buffer)
ADB>    t)

Aaron,

the latest CVS Gnus and Emacs have:

(defun imap-quote-specials (string)
  (with-temp-buffer
    (insert string)
    (goto-char (point-min))
    (while (re-search-forward "[\\\"]" nil t)
      (forward-char -1)
      (insert "\\")
      (forward-char 1))
    (buffer-string)))

(it gets called for user name, password, etc. and escapes backslash as
well)

I think that will solve your problem, if you can use a more recent Emacs
or Gnus.

Thanks
Ted




bug closed, send any further explanations to "Aaron D. Ball" <adb <at> broad.mit.edu> Request was from Chong Yidong <cyd <at> stupidchicken.com> to control <at> emacsbugs.donarmstrong.com. (Sun, 16 Nov 2008 00:35:02 GMT) Full text and rfc822 format available.

bug archived. Request was from Debbugs Internal Request <don <at> donarmstrong.com> to internal_control <at> emacsbugs.donarmstrong.com. (Sun, 14 Dec 2008 15:24:04 GMT) Full text and rfc822 format available.

This bug report was last modified 16 years and 192 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.