unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Michael Albinus <michael.albinus@gmx.de>
To: Stephane Chauveau <stephane@chauveau-central.net>
Cc: 19047@debbugs.gnu.org
Subject: bug#19047: Acknowledgement (Tramp reuses bad ssh passphrase several times without asking)
Date: Sat, 22 Nov 2014 18:00:57 +0100	[thread overview]
Message-ID: <87d28f9nli.fsf@gmx.de> (raw)
In-Reply-To: <54650874.6030007@chauveau-central.net> (Stephane Chauveau's message of "Thu, 13 Nov 2014 20:37:24 +0100")

Stephane Chauveau <stephane@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.





  reply	other threads:[~2014-11-22 17:00 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-11-13 18:29 bug#19047: Tramp reuses bad ssh passphrase several times without asking Stephane Chauveau
     [not found] ` <handler.19047.B.141590355422305.ack@debbugs.gnu.org>
2014-11-13 19:37   ` bug#19047: Acknowledgement (Tramp reuses bad ssh passphrase several times without asking) Stephane Chauveau
2014-11-22 17:00     ` Michael Albinus [this message]
2014-11-22 17:20       ` Stephane Chauveau
2014-11-22 18:56         ` Michael Albinus

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87d28f9nli.fsf@gmx.de \
    --to=michael.albinus@gmx.de \
    --cc=19047@debbugs.gnu.org \
    --cc=stephane@chauveau-central.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).