diff options
| author | Michael Albinus | 2014-03-06 14:23:04 +0100 |
|---|---|---|
| committer | Michael Albinus | 2014-03-06 14:23:04 +0100 |
| commit | fa965cbf7420c7ee5a0dde0df472592cd3aa2a1d (patch) | |
| tree | e1daaa1e55e9d8e55cb7faa53dbddc1896f5f467 | |
| parent | 7c45220b0323576d27df26154a87187359fd874a (diff) | |
| download | emacs-fa965cbf7420c7ee5a0dde0df472592cd3aa2a1d.tar.gz emacs-fa965cbf7420c7ee5a0dde0df472592cd3aa2a1d.zip | |
* net/tramp.el (tramp-error): VEC-OR-PROC can be nil.
(tramp-action-password): Clear password cache if needed.
(tramp-read-passwd): Do not clear password cache.
* net/tramp-gvfs.el (tramp-gvfs-handler-askpassword): Clear password
cache unless it is the first password request.
| -rw-r--r-- | lisp/ChangeLog | 9 | ||||
| -rw-r--r-- | lisp/net/tramp-gvfs.el | 8 | ||||
| -rw-r--r-- | lisp/net/tramp.el | 26 |
3 files changed, 30 insertions, 13 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog index ae71a8f8e65..57057e8a24e 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog | |||
| @@ -1,3 +1,12 @@ | |||
| 1 | 2014-03-06 Michael Albinus <michael.albinus@gmx.de> | ||
| 2 | |||
| 3 | * net/tramp.el (tramp-error): VEC-OR-PROC can be nil. | ||
| 4 | (tramp-action-password): Clear password cache if needed. | ||
| 5 | (tramp-read-passwd): Do not clear password cache. | ||
| 6 | |||
| 7 | * net/tramp-gvfs.el (tramp-gvfs-handler-askpassword): Clear password | ||
| 8 | cache unless it is the first password request. | ||
| 9 | |||
| 1 | 2014-03-06 Glenn Morris <rgm@gnu.org> | 10 | 2014-03-06 Glenn Morris <rgm@gnu.org> |
| 2 | 11 | ||
| 3 | * simple.el (newline): Doc tweak. | 12 | * simple.el (newline): Doc tweak. |
diff --git a/lisp/net/tramp-gvfs.el b/lisp/net/tramp-gvfs.el index 320e00c681d..52189e091fb 100644 --- a/lisp/net/tramp-gvfs.el +++ b/lisp/net/tramp-gvfs.el | |||
| @@ -1180,10 +1180,14 @@ ADDRESS can have the form \"xx:xx:xx:xx:xx:xx\" or \"[xx:xx:xx:xx:xx:xx]\"." | |||
| 1180 | (zerop (logand flags tramp-gvfs-password-need-username)))) | 1180 | (zerop (logand flags tramp-gvfs-password-need-username)))) |
| 1181 | (setq user (read-string "User name: "))) | 1181 | (setq user (read-string "User name: "))) |
| 1182 | (when (and (zerop (length domain)) | 1182 | (when (and (zerop (length domain)) |
| 1183 | (not (zerop (logand flags tramp-gvfs-password-need-domain)))) | 1183 | (not |
| 1184 | (zerop (logand flags tramp-gvfs-password-need-domain)))) | ||
| 1184 | (setq domain (read-string "Domain name: "))) | 1185 | (setq domain (read-string "Domain name: "))) |
| 1185 | 1186 | ||
| 1186 | (tramp-message l 6 "%S %S %S %d" message user domain flags) | 1187 | (tramp-message l 6 "%S %S %S %d" message user domain flags) |
| 1188 | (unless (tramp-get-connection-property l "first-password-request" nil) | ||
| 1189 | (tramp-clear-passwd l)) | ||
| 1190 | |||
| 1187 | (setq tramp-current-method l-method | 1191 | (setq tramp-current-method l-method |
| 1188 | tramp-current-user user | 1192 | tramp-current-user user |
| 1189 | tramp-current-host l-host | 1193 | tramp-current-host l-host |
| @@ -1474,7 +1478,7 @@ connection if a previous connection has died for some reason." | |||
| 1474 | (format "Opening connection for %s using %s" host method) | 1478 | (format "Opening connection for %s using %s" host method) |
| 1475 | (format "Opening connection for %s@%s using %s" user host method)) | 1479 | (format "Opening connection for %s@%s using %s" user host method)) |
| 1476 | 1480 | ||
| 1477 | ;; Enable auth-source and password-cache. | 1481 | ;; Enable `auth-source'. |
| 1478 | (tramp-set-connection-property vec "first-password-request" t) | 1482 | (tramp-set-connection-property vec "first-password-request" t) |
| 1479 | 1483 | ||
| 1480 | ;; There will be a callback of "askPassword" when a password is | 1484 | ;; There will be a callback of "askPassword" when a password is |
diff --git a/lisp/net/tramp.el b/lisp/net/tramp.el index 7d88869a0d1..face017946d 100644 --- a/lisp/net/tramp.el +++ b/lisp/net/tramp.el | |||
| @@ -1560,12 +1560,13 @@ signal identifier to be raised, remaining arguments passed to | |||
| 1560 | `tramp-message'. Finally, signal SIGNAL is raised." | 1560 | `tramp-message'. Finally, signal SIGNAL is raised." |
| 1561 | (let (tramp-message-show-message) | 1561 | (let (tramp-message-show-message) |
| 1562 | (tramp-backtrace vec-or-proc) | 1562 | (tramp-backtrace vec-or-proc) |
| 1563 | (tramp-message | 1563 | (when vec-or-proc |
| 1564 | vec-or-proc 1 "%s" | 1564 | (tramp-message |
| 1565 | (error-message-string | 1565 | vec-or-proc 1 "%s" |
| 1566 | (list signal | 1566 | (error-message-string |
| 1567 | (get signal 'error-message) | 1567 | (list signal |
| 1568 | (apply 'format fmt-string arguments)))) | 1568 | (get signal 'error-message) |
| 1569 | (apply 'format fmt-string arguments))))) | ||
| 1569 | (signal signal (list (apply 'format fmt-string arguments))))) | 1570 | (signal signal (list (apply 'format fmt-string arguments))))) |
| 1570 | 1571 | ||
| 1571 | (defsubst tramp-error-with-buffer | 1572 | (defsubst tramp-error-with-buffer |
| @@ -3400,6 +3401,12 @@ of." | |||
| 3400 | (with-current-buffer (process-buffer proc) | 3401 | (with-current-buffer (process-buffer proc) |
| 3401 | (let ((enable-recursive-minibuffers t) | 3402 | (let ((enable-recursive-minibuffers t) |
| 3402 | (case-fold-search t)) | 3403 | (case-fold-search t)) |
| 3404 | ;; Let's check whether a wrong password has been sent already. | ||
| 3405 | ;; Sometimes, the process returns a new password request | ||
| 3406 | ;; immediately after rejecting the previous (wrong) one. | ||
| 3407 | (goto-char (point-min)) | ||
| 3408 | (when (search-forward-regexp tramp-wrong-passwd-regexp nil t) | ||
| 3409 | (tramp-clear-passwd vec)) | ||
| 3403 | (tramp-check-for-regexp proc tramp-password-prompt-regexp) | 3410 | (tramp-check-for-regexp proc tramp-password-prompt-regexp) |
| 3404 | (tramp-message vec 3 "Sending %s" (match-string 1)) | 3411 | (tramp-message vec 3 "Sending %s" (match-string 1)) |
| 3405 | ;; We don't call `tramp-send-string' in order to hide the | 3412 | ;; We don't call `tramp-send-string' in order to hide the |
| @@ -3508,8 +3515,8 @@ The terminal type can be configured with `tramp-terminal-type'." | |||
| 3508 | PROC and VEC indicate the remote connection to be used. POS, if | 3515 | PROC and VEC indicate the remote connection to be used. POS, if |
| 3509 | set, is the starting point of the region to be deleted in the | 3516 | set, is the starting point of the region to be deleted in the |
| 3510 | connection buffer." | 3517 | connection buffer." |
| 3511 | ;; Enable `auth-source' and `password-cache'. We must use | 3518 | ;; Enable `auth-source'. We must use tramp-current-* variables in |
| 3512 | ;; tramp-current-* variables in case we have several hops. | 3519 | ;; case we have several hops. |
| 3513 | (tramp-set-connection-property | 3520 | (tramp-set-connection-property |
| 3514 | (tramp-dissect-file-name | 3521 | (tramp-dissect-file-name |
| 3515 | (tramp-make-tramp-file-name | 3522 | (tramp-make-tramp-file-name |
| @@ -4131,9 +4138,6 @@ Invokes `password-read' if available, `read-passwd' else." | |||
| 4131 | "password" tramp-current-host tramp-current-method))) | 4138 | "password" tramp-current-host tramp-current-method))) |
| 4132 | ;; Try the password cache. | 4139 | ;; Try the password cache. |
| 4133 | (when (functionp 'password-read) | 4140 | (when (functionp 'password-read) |
| 4134 | (unless (tramp-get-connection-property | ||
| 4135 | v "first-password-request" nil) | ||
| 4136 | (tramp-compat-funcall 'password-cache-remove key)) | ||
| 4137 | (let ((password | 4141 | (let ((password |
| 4138 | (tramp-compat-funcall 'password-read pw-prompt key))) | 4142 | (tramp-compat-funcall 'password-read pw-prompt key))) |
| 4139 | (tramp-compat-funcall 'password-cache-add key password) | 4143 | (tramp-compat-funcall 'password-cache-add key password) |