GNU bug report logs - #19047
Tramp reuses bad ssh passphrase several times without asking

Previous Next

Package: emacs;

Reported by: Stephane Chauveau <stephane <at> chauveau-central.net>

Date: Thu, 13 Nov 2014 18:33:02 UTC

Severity: normal

Done: Michael Albinus <michael.albinus <at> gmx.de>

Bug is archived. No further changes may be made.

Full log


Message #11 received at 19047 <at> debbugs.gnu.org (full text, mbox):

From: Michael Albinus <michael.albinus <at> gmx.de>
To: Stephane Chauveau <stephane <at> chauveau-central.net>
Cc: 19047 <at> debbugs.gnu.org
Subject: Re: bug#19047: Acknowledgement (Tramp reuses bad ssh passphrase
 several times without asking)
Date: Sat, 22 Nov 2014 18:00:57 +0100
Stephane Chauveau <stephane <at> chauveau-central.net> writes:

> In function tramp-action-password, some codes were added to clear the
> 'wrong' password:
>
>  ;; Let's check whether a wrong password has been sent already.
>  ;; Sometimes, the process returns a new password request
>  ;; immediately after rejecting the previous (wrong) one.
>  (goto-char (point-min))
>  (when (search-forward-regexp tramp-wrong-passwd-regexp nil t)
>    (tramp-clear-passwd vec))
>
> That code probably does not work because there is nothing to match with
> tramp-password-prompt-regexp after the Enter passphrase prompt.

Finally, I have pushed a patch towards the emacs-24 branch, which shall
fix it. For testing:

--8<---------------cut here---------------start------------->8---
*** /home/albinus/src/emacs-24/lisp/net/tramp.el	2014-11-22 18:54:33.000000000 +0200
--- /home/albinus/src/emacs-24/lisp/net/tramp.el.~6ec5ee8872bfb8b0ebc53d98fcb8f284e08c147f~	2014-11-22 18:54:33.000000000 +0200
***************
*** 3445,3453 ****
        ;; Let's check whether a wrong password has been sent already.
        ;; Sometimes, the process returns a new password request
        ;; immediately after rejecting the previous (wrong) one.
!       (goto-char (point-min))
!       (when (search-forward-regexp tramp-wrong-passwd-regexp nil t)
  	(tramp-clear-passwd vec))
        (tramp-check-for-regexp proc tramp-password-prompt-regexp)
        (tramp-message vec 3 "Sending %s" (match-string 1))
        ;; We don't call `tramp-send-string' in order to hide the
--- 3445,3453 ----
        ;; Let's check whether a wrong password has been sent already.
        ;; Sometimes, the process returns a new password request
        ;; immediately after rejecting the previous (wrong) one.
!       (unless (tramp-get-connection-property vec "first-password-request" nil)
  	(tramp-clear-passwd vec))
+       (goto-char (point-min))
        (tramp-check-for-regexp proc tramp-password-prompt-regexp)
        (tramp-message vec 3 "Sending %s" (match-string 1))
        ;; We don't call `tramp-send-string' in order to hide the
--8<---------------cut here---------------end--------------->8---

Thanks for your report, and best regards, Michael.




This bug report was last modified 10 years and 184 days ago.

Previous Next


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