emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] emacs/lisp/net tramp.el


From: Michael Albinus
Subject: [Emacs-diffs] emacs/lisp/net tramp.el
Date: Thu, 29 Jan 2009 16:22:59 +0000

CVSROOT:        /sources/emacs
Module name:    emacs
Changes by:     Michael Albinus <albinus>       09/01/29 16:22:59

Modified files:
        lisp/net       : tramp.el 

Log message:
        * net/tramp.el (tramp-process-actions, tramp-read-passwd): Allow
        correction of passwords.

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/emacs/lisp/net/tramp.el?cvsroot=emacs&r1=1.226&r2=1.227

Patches:
Index: tramp.el
===================================================================
RCS file: /sources/emacs/emacs/lisp/net/tramp.el,v
retrieving revision 1.226
retrieving revision 1.227
diff -u -b -r1.226 -r1.227
--- tramp.el    19 Jan 2009 06:51:55 -0000      1.226
+++ tramp.el    29 Jan 2009 16:22:58 -0000      1.227
@@ -5797,6 +5797,8 @@
 
 (defun tramp-process-actions (proc vec actions &optional timeout)
   "Perform actions until success or TIMEOUT."
+  ;; Enable auth-sorce and password-cache.
+  (tramp-set-connection-property proc "first-password-request" t)
   (let (exit)
     (while (not exit)
       (tramp-message proc 3 "Waiting for prompts from remote shell")
@@ -7422,20 +7424,24 @@
              (with-current-buffer (process-buffer proc)
                (tramp-check-for-regexp proc tramp-password-prompt-regexp)
                (format "%s for %s " (capitalize (match-string 1)) key)))))
-
+    (prog1
     (or
      ;; See if auth-sources contains something useful, if it's bound.
-     (when (boundp 'auth-sources)
+        (and (boundp 'auth-sources)
+             (tramp-get-connection-property proc "first-password-request" nil)
        ;; Try with Tramp's current method.
        (funcall (symbol-function 'auth-source-user-or-password)
                "password" tramp-current-host tramp-current-method))
-     ;; Else, get the password interactively.
-     (if (functionp 'password-read)
+        ;; Try the password cache.
+        (and (functionp 'password-read)
+             (tramp-get-connection-property proc "first-password-request" nil)
         (let ((password (funcall (symbol-function 'password-read)
                                  pw-prompt key)))
           (funcall (symbol-function 'password-cache-add) key password)
-          password)
-       (read-passwd pw-prompt)))))
+               password))
+        ;; Else, get the password interactively.
+        (read-passwd pw-prompt))
+      (tramp-set-connection-property proc "first-password-request" nil))))
 
 (defun tramp-clear-passwd (vec)
   "Clear password cache for connection related to VEC."
@@ -7664,8 +7670,6 @@
 ;;   long command lines.
 ;; * `vc-directory' does not work.  It never displays any files, even
 ;;   if it does show files when run locally.
-;; * Allow correction of passwords, if the remote end allows this.
-;;   (Mark Hershberger)
 ;; * How to deal with MULE in `insert-file-contents' and `write-region'?
 ;; * Grok `append' parameter for `write-region'.
 ;; * Test remote ksh or bash for tilde expansion in `tramp-find-shell'?




reply via email to

[Prev in Thread] Current Thread [Next in Thread]