aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Albinus2009-01-29 16:26:53 +0000
committerMichael Albinus2009-01-29 16:26:53 +0000
commit5c7043a24839398e73bf783fdb430cd266083dee (patch)
tree027ddfc10e3b358e1af5e67d1084c90b2f9789f8
parent3a67b387665e7e554b0a61f026f670a7b3e4523b (diff)
downloademacs-5c7043a24839398e73bf783fdb430cd266083dee.tar.gz
emacs-5c7043a24839398e73bf783fdb430cd266083dee.zip
* net/tramp.el (tramp-process-actions, tramp-read-passwd): Allow
correction of passwords.
-rw-r--r--lisp/ChangeLog5
-rw-r--r--lisp/net/tramp.el36
2 files changed, 25 insertions, 16 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index be0878c81a9..fe7441cf11b 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,3 +1,8 @@
12009-01-29 Michael Albinus <michael.albinus@gmx.de>
2
3 * net/tramp.el (tramp-process-actions, tramp-read-passwd): Allow
4 correction of passwords.
5
12009-01-29 Chong Yidong <cyd@stupidchicken.com> 62009-01-29 Chong Yidong <cyd@stupidchicken.com>
2 7
3 * mail/rmail.el (rmail-toggle-header): Determine current header 8 * mail/rmail.el (rmail-toggle-header): Determine current header
diff --git a/lisp/net/tramp.el b/lisp/net/tramp.el
index 5814810dd53..e222a01a273 100644
--- a/lisp/net/tramp.el
+++ b/lisp/net/tramp.el
@@ -5797,6 +5797,8 @@ The terminal type can be configured with `tramp-terminal-type'."
5797 5797
5798(defun tramp-process-actions (proc vec actions &optional timeout) 5798(defun tramp-process-actions (proc vec actions &optional timeout)
5799 "Perform actions until success or TIMEOUT." 5799 "Perform actions until success or TIMEOUT."
5800 ;; Enable auth-sorce and password-cache.
5801 (tramp-set-connection-property proc "first-password-request" t)
5800 (let (exit) 5802 (let (exit)
5801 (while (not exit) 5803 (while (not exit)
5802 (tramp-message proc 3 "Waiting for prompts from remote shell") 5804 (tramp-message proc 3 "Waiting for prompts from remote shell")
@@ -7422,20 +7424,24 @@ Invokes `password-read' if available, `read-passwd' else."
7422 (with-current-buffer (process-buffer proc) 7424 (with-current-buffer (process-buffer proc)
7423 (tramp-check-for-regexp proc tramp-password-prompt-regexp) 7425 (tramp-check-for-regexp proc tramp-password-prompt-regexp)
7424 (format "%s for %s " (capitalize (match-string 1)) key))))) 7426 (format "%s for %s " (capitalize (match-string 1)) key)))))
7425 7427 (prog1
7426 (or 7428 (or
7427 ;; See if auth-sources contains something useful, if it's bound. 7429 ;; See if auth-sources contains something useful, if it's bound.
7428 (when (boundp 'auth-sources) 7430 (and (boundp 'auth-sources)
7429 ;; Try with Tramp's current method. 7431 (tramp-get-connection-property proc "first-password-request" nil)
7430 (funcall (symbol-function 'auth-source-user-or-password) 7432 ;; Try with Tramp's current method.
7431 "password" tramp-current-host tramp-current-method)) 7433 (funcall (symbol-function 'auth-source-user-or-password)
7432 ;; Else, get the password interactively. 7434 "password" tramp-current-host tramp-current-method))
7433 (if (functionp 'password-read) 7435 ;; Try the password cache.
7434 (let ((password (funcall (symbol-function 'password-read) 7436 (and (functionp 'password-read)
7435 pw-prompt key))) 7437 (tramp-get-connection-property proc "first-password-request" nil)
7436 (funcall (symbol-function 'password-cache-add) key password) 7438 (let ((password (funcall (symbol-function 'password-read)
7437 password) 7439 pw-prompt key)))
7438 (read-passwd pw-prompt))))) 7440 (funcall (symbol-function 'password-cache-add) key password)
7441 password))
7442 ;; Else, get the password interactively.
7443 (read-passwd pw-prompt))
7444 (tramp-set-connection-property proc "first-password-request" nil))))
7439 7445
7440(defun tramp-clear-passwd (vec) 7446(defun tramp-clear-passwd (vec)
7441 "Clear password cache for connection related to VEC." 7447 "Clear password cache for connection related to VEC."
@@ -7664,8 +7670,6 @@ Only works for Bourne-like shells."
7664;; long command lines. 7670;; long command lines.
7665;; * `vc-directory' does not work. It never displays any files, even 7671;; * `vc-directory' does not work. It never displays any files, even
7666;; if it does show files when run locally. 7672;; if it does show files when run locally.
7667;; * Allow correction of passwords, if the remote end allows this.
7668;; (Mark Hershberger)
7669;; * How to deal with MULE in `insert-file-contents' and `write-region'? 7673;; * How to deal with MULE in `insert-file-contents' and `write-region'?
7670;; * Grok `append' parameter for `write-region'. 7674;; * Grok `append' parameter for `write-region'.
7671;; * Test remote ksh or bash for tilde expansion in `tramp-find-shell'? 7675;; * Test remote ksh or bash for tilde expansion in `tramp-find-shell'?