aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Albinus2010-02-15 16:04:53 +0100
committerMichael Albinus2010-02-15 16:04:53 +0100
commit7540f029959d8e67882d1304419171424143e494 (patch)
treebb3d30333292abb546671dc310f99893f060bb88
parent737b5223e1c9521ecd8195185c4dbb3669e5a71c (diff)
downloademacs-7540f029959d8e67882d1304419171424143e494.tar.gz
emacs-7540f029959d8e67882d1304419171424143e494.zip
* net/tramp.el (tramp-process-actions, tramp-read-passwd):
* net/tramp-gvfs.el (tramp-gvfs-maybe-open-connection): Use VEC instead of PROC for caching "first-password-request". Otherwise, new processes would not profit from passwords already entered. * net/tramp-cache.el (tramp-dump-connection-properties): Don't save "first-password-request" property.
-rw-r--r--lisp/ChangeLog10
-rw-r--r--lisp/net/tramp-cache.el7
-rw-r--r--lisp/net/tramp-gvfs.el3
-rw-r--r--lisp/net/tramp.el48
4 files changed, 41 insertions, 27 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index 52ca0354c29..8f1c5574e41 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,3 +1,13 @@
12010-02-15 Michael Albinus <michael.albinus@gmx.de>
2
3 * net/tramp.el (tramp-process-actions, tramp-read-passwd):
4 * net/tramp-gvfs.el (tramp-gvfs-maybe-open-connection): Use VEC
5 instead of PROC for caching "first-password-request". Otherwise,
6 new processes would not profit from passwords already entered.
7
8 * net/tramp-cache.el (tramp-dump-connection-properties): Don't
9 save "first-password-request" property.
10
12010-02-14 Juanma Barranquero <lekktu@gmail.com> 112010-02-14 Juanma Barranquero <lekktu@gmail.com>
2 12
3 * outline.el (outline-head-from-level): 13 * outline.el (outline-head-from-level):
diff --git a/lisp/net/tramp-cache.el b/lisp/net/tramp-cache.el
index 4338a6edad1..ac86fabe3a9 100644
--- a/lisp/net/tramp-cache.el
+++ b/lisp/net/tramp-cache.el
@@ -1,7 +1,7 @@
1;;; tramp-cache.el --- file information caching for Tramp 1;;; tramp-cache.el --- file information caching for Tramp
2 2
3;; Copyright (C) 2000, 2005, 2006, 2007, 2008, 3;; Copyright (C) 2000, 2005, 2006, 2007, 2008, 2009,
4;; 2009, 2010 Free Software Foundation, Inc. 4;; 2010 Free Software Foundation, Inc.
5 5
6;; Author: Daniel Pittman <daniel@inanna.danann.net> 6;; Author: Daniel Pittman <daniel@inanna.danann.net>
7;; Michael Albinus <michael.albinus@gmx.de> 7;; Michael Albinus <michael.albinus@gmx.de>
@@ -295,7 +295,8 @@ KEY identifies the connection, it is either a process or a vector."
295 (if (and (vectorp key) (not (tramp-file-name-localname key))) 295 (if (and (vectorp key) (not (tramp-file-name-localname key)))
296 (progn 296 (progn
297 (remhash "process-name" value) 297 (remhash "process-name" value)
298 (remhash "process-buffer" value)) 298 (remhash "process-buffer" value)
299 (remhash "first-password-request" value))
299 (remhash key cache))) 300 (remhash key cache)))
300 cache) 301 cache)
301 ;; Dump it. 302 ;; Dump it.
diff --git a/lisp/net/tramp-gvfs.el b/lisp/net/tramp-gvfs.el
index 3f1e1a463d3..a80e0f27752 100644
--- a/lisp/net/tramp-gvfs.el
+++ b/lisp/net/tramp-gvfs.el
@@ -1057,8 +1057,7 @@ connection if a previous connection has died for some reason."
1057 vec 3 "Opening connection for %s@%s using %s..." user host method)) 1057 vec 3 "Opening connection for %s@%s using %s..." user host method))
1058 1058
1059 ;; Enable auth-sorce and password-cache. 1059 ;; Enable auth-sorce and password-cache.
1060 (tramp-set-connection-property 1060 (tramp-set-connection-property vec "first-password-request" t)
1061 (tramp-get-connection-process vec) "first-password-request" t)
1062 1061
1063 ;; There will be a callback of "askPassword", when a password is 1062 ;; There will be a callback of "askPassword", when a password is
1064 ;; needed. 1063 ;; needed.
diff --git a/lisp/net/tramp.el b/lisp/net/tramp.el
index a573a75afe2..e59383e31e7 100644
--- a/lisp/net/tramp.el
+++ b/lisp/net/tramp.el
@@ -6539,7 +6539,7 @@ The terminal type can be configured with `tramp-terminal-type'."
6539(defun tramp-process-actions (proc vec actions &optional timeout) 6539(defun tramp-process-actions (proc vec actions &optional timeout)
6540 "Perform actions until success or TIMEOUT." 6540 "Perform actions until success or TIMEOUT."
6541 ;; Enable auth-source and password-cache. 6541 ;; Enable auth-source and password-cache.
6542 (tramp-set-connection-property proc "first-password-request" t) 6542 (tramp-set-connection-property vec "first-password-request" t)
6543 (let (exit) 6543 (let (exit)
6544 (while (not exit) 6544 (while (not exit)
6545 (tramp-message proc 3 "Waiting for prompts from remote shell") 6545 (tramp-message proc 3 "Waiting for prompts from remote shell")
@@ -8320,26 +8320,27 @@ Invokes `password-read' if available, `read-passwd' else."
8320 (with-current-buffer (process-buffer proc) 8320 (with-current-buffer (process-buffer proc)
8321 (tramp-check-for-regexp proc tramp-password-prompt-regexp) 8321 (tramp-check-for-regexp proc tramp-password-prompt-regexp)
8322 (format "%s for %s " (capitalize (match-string 1)) key))))) 8322 (format "%s for %s " (capitalize (match-string 1)) key)))))
8323 (prog1 8323 (with-parsed-tramp-file-name key nil
8324 (or 8324 (prog1
8325 ;; See if auth-sources contains something useful, if it's bound. 8325 (or
8326 (and (boundp 'auth-sources) 8326 ;; See if auth-sources contains something useful, if it's bound.
8327 (tramp-get-connection-property proc "first-password-request" nil) 8327 (and (boundp 'auth-sources)
8328 ;; Try with Tramp's current method. 8328 (tramp-get-connection-property v "first-password-request" nil)
8329 (funcall (symbol-function 'auth-source-user-or-password) 8329 ;; Try with Tramp's current method.
8330 "password" tramp-current-host tramp-current-method)) 8330 (funcall (symbol-function 'auth-source-user-or-password)
8331 ;; Try the password cache. 8331 "password" tramp-current-host tramp-current-method))
8332 (when (functionp 'password-read) 8332 ;; Try the password cache.
8333 (unless (tramp-get-connection-property 8333 (when (functionp 'password-read)
8334 proc "first-password-request" nil) 8334 (unless (tramp-get-connection-property
8335 (funcall (symbol-function 'password-cache-remove) key)) 8335 v "first-password-request" nil)
8336 (let ((password 8336 (funcall (symbol-function 'password-cache-remove) key))
8337 (funcall (symbol-function 'password-read) pw-prompt key))) 8337 (let ((password
8338 (funcall (symbol-function 'password-cache-add) key password) 8338 (funcall (symbol-function 'password-read) pw-prompt key)))
8339 password)) 8339 (funcall (symbol-function 'password-cache-add) key password)
8340 ;; Else, get the password interactively. 8340 password))
8341 (read-passwd pw-prompt)) 8341 ;; Else, get the password interactively.
8342 (tramp-set-connection-property proc "first-password-request" nil)))) 8342 (read-passwd pw-prompt))
8343 (tramp-set-connection-property v "first-password-request" nil)))))
8343 8344
8344(defun tramp-clear-passwd (vec) 8345(defun tramp-clear-passwd (vec)
8345 "Clear password cache for connection related to VEC." 8346 "Clear password cache for connection related to VEC."
@@ -8585,7 +8586,7 @@ Only works for Bourne-like shells."
8585;; rsync). 8586;; rsync).
8586;; * Keep a second connection open for out-of-band methods like scp or 8587;; * Keep a second connection open for out-of-band methods like scp or
8587;; rsync. 8588;; rsync.
8588;; * Support ptys in `tramp-handle-start-file-process'. 8589;; * Support ptys in `tramp-handle-start-file-process'. (Bug#4604)
8589;; * IMHO, it's a drawback that currently Tramp doesn't support 8590;; * IMHO, it's a drawback that currently Tramp doesn't support
8590;; Unicode in Dired file names by default. Is it possible to 8591;; Unicode in Dired file names by default. Is it possible to
8591;; improve Tramp to set LC_ALL to "C" only for commands where Tramp 8592;; improve Tramp to set LC_ALL to "C" only for commands where Tramp
@@ -8596,6 +8597,9 @@ Only works for Bourne-like shells."
8596;; * Load Tramp subpackages only when needed. (Bug#1529, Bug#5448) 8597;; * Load Tramp subpackages only when needed. (Bug#1529, Bug#5448)
8597;; * Try telnet+curl as new method. It might be useful for busybox, 8598;; * Try telnet+curl as new method. It might be useful for busybox,
8598;; without built-in uuencode/uudecode. 8599;; without built-in uuencode/uudecode.
8600;; * Let `shell-dynamic-complete-*' and `comint-dynamic-complete' work
8601;; on remote hosts.
8602;; * Use secrets.el for password handling.
8599 8603
8600;; Functions for file-name-handler-alist: 8604;; Functions for file-name-handler-alist:
8601;; diff-latest-backup-file -- in diff.el 8605;; diff-latest-backup-file -- in diff.el