]> git.eshelyaron.com Git - emacs.git/commitdiff
* net/tramp.el (tramp-process-actions): Set "first-password-request"
authorMichael Albinus <michael.albinus@gmx.de>
Wed, 18 May 2011 12:59:25 +0000 (14:59 +0200)
committerMichael Albinus <michael.albinus@gmx.de>
Wed, 18 May 2011 12:59:25 +0000 (14:59 +0200)
property for the correct connection in case of multihops.

lisp/ChangeLog
lisp/net/tramp.el

index be5312a6f2b6f269b9aa22db3cae66de6b651f51..15bd4b190b221bfd0b085f9fd8bc0343179d274d 100644 (file)
@@ -1,3 +1,8 @@
+2011-05-18  Michael Albinus  <michael.albinus@gmx.de>
+
+       * net/tramp.el (tramp-process-actions): Set "first-password-request"
+       property for the correct connection in case of multihops.
+
 2011-05-18  Glenn Morris  <rgm@gnu.org>
 
        * emacs-lisp/authors.el (authors-fixed-entries): Remove fakemail.c.
index bc831c3b596ab844ee202f3e2c76b722d8a2e3a1..537ccf6da6a265aa5853a68a47308d475afb0807 100644 (file)
@@ -3105,8 +3105,13 @@ set, is the starting point of the region to be deleted in the
 connection buffer."
   ;; Preserve message for `progress-reporter'.
   (tramp-compat-with-temp-message ""
-    ;; Enable auth-source and password-cache.
-    (tramp-set-connection-property vec "first-password-request" t)
+    ;; Enable auth-source and password-cache.  We must use
+    ;; tramp-current-* variables in case we have several hops.
+    (tramp-set-connection-property
+     (tramp-dissect-file-name
+      (tramp-make-tramp-file-name
+       tramp-current-method tramp-current-user tramp-current-host ""))
+     "first-password-request" t)
     (save-restriction
       (let (exit)
        (while (not exit)
@@ -3544,16 +3549,16 @@ Invokes `password-read' if available, `read-passwd' else."
                ;; Try with Tramp's current method.
                 (if (fboundp 'auth-source-search)
                    (setq auth-info
-                            (tramp-compat-funcall
-                             'auth-source-search
-                             :max 1
-                             :user (or tramp-current-user t)
-                             :host tramp-current-host
-                             :port tramp-current-method)
-                           auth-passwd (plist-get (nth 0 auth-info) :secret)
-                           auth-passwd (if (functionp auth-passwd)
-                                            (funcall auth-passwd)
-                                          auth-passwd))
+                         (tramp-compat-funcall
+                          'auth-source-search
+                          :max 1
+                          :user (or tramp-current-user t)
+                          :host tramp-current-host
+                          :port tramp-current-method)
+                         auth-passwd (plist-get (nth 0 auth-info) :secret)
+                         auth-passwd (if (functionp auth-passwd)
+                                         (funcall auth-passwd)
+                                       auth-passwd))
                   (tramp-compat-funcall
                    'auth-source-user-or-password
                    "password" tramp-current-host tramp-current-method)))