aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Albinus2016-09-21 20:02:54 +0200
committerMichael Albinus2016-09-21 20:02:54 +0200
commitaf0fb5097103b8fb86499c49b943ee7f347bb138 (patch)
treee2b13c59e453ea91c09e0ae7c0efde9ed1519108
parent516ce2cdc4ce293aed393440aaac29944a7d5a55 (diff)
downloademacs-af0fb5097103b8fb86499c49b943ee7f347bb138.tar.gz
emacs-af0fb5097103b8fb86499c49b943ee7f347bb138.zip
; * lisp/net/tramp.el (tramp-clear-passwd): Make it compatible to Emacs 23
-rw-r--r--lisp/net/tramp.el32
1 files changed, 15 insertions, 17 deletions
diff --git a/lisp/net/tramp.el b/lisp/net/tramp.el
index 2361b078c99..44afc0aa6f0 100644
--- a/lisp/net/tramp.el
+++ b/lisp/net/tramp.el
@@ -4169,7 +4169,8 @@ Invokes `password-read' if available, `read-passwd' else."
4169 auth-passwd (if (functionp auth-passwd) 4169 auth-passwd (if (functionp auth-passwd)
4170 (funcall auth-passwd) 4170 (funcall auth-passwd)
4171 auth-passwd)) 4171 auth-passwd))
4172 (tramp-compat-funcall 'auth-source-user-or-password 4172 (tramp-compat-funcall
4173 'auth-source-user-or-password
4173 "password" tramp-current-host tramp-current-method)))) 4174 "password" tramp-current-host tramp-current-method))))
4174 ;; Try the password cache. 4175 ;; Try the password cache.
4175 (let ((password (password-read pw-prompt key))) 4176 (let ((password (password-read pw-prompt key)))
@@ -4184,7 +4185,10 @@ Invokes `password-read' if available, `read-passwd' else."
4184;;;###tramp-autoload 4185;;;###tramp-autoload
4185(defun tramp-clear-passwd (vec) 4186(defun tramp-clear-passwd (vec)
4186 "Clear password cache for connection related to VEC." 4187 "Clear password cache for connection related to VEC."
4187 (let ((hop (tramp-file-name-hop vec))) 4188 (let ((method (tramp-file-name-method vec))
4189 (user (tramp-file-name-user vec))
4190 (host (tramp-file-name-host vec))
4191 (hop (tramp-file-name-hop vec)))
4188 (when hop 4192 (when hop
4189 ;; Clear also the passwords of the hops. 4193 ;; Clear also the passwords of the hops.
4190 (tramp-clear-passwd 4194 (tramp-clear-passwd
@@ -4193,21 +4197,15 @@ Invokes `password-read' if available, `read-passwd' else."
4193 tramp-prefix-format 4197 tramp-prefix-format
4194 (replace-regexp-in-string 4198 (replace-regexp-in-string
4195 (concat tramp-postfix-hop-regexp "$") 4199 (concat tramp-postfix-hop-regexp "$")
4196 tramp-postfix-host-format hop)))))) 4200 tramp-postfix-host-format hop)))))
4197 ;; `auth-source-forget' has been obsoleted with Emacs 24.1. But 4201 ;; `auth-source-forget-user-or-password' is an obsoleted function
4198 ;; there is no known replacement. 4202 ;; since Emacs 24.1, it has been replaced by `auth-source-forget'.
4199 (when (fboundp 'auth-source-forget) 4203 (if (fboundp 'auth-source-forget)
4200 (auth-source-forget 4204 (auth-source-forget
4201 `(:max 1 4205 `(:max 1 :user ,(or user t) :host ,host :port ,method))
4202 :user ,(or (tramp-file-name-user vec) t) 4206 (tramp-compat-funcall
4203 :host ,(tramp-file-name-host vec) 4207 'auth-source-forget-user-or-password "password" host method))
4204 :port ,(tramp-file-name-method vec)))) 4208 (password-cache-remove (tramp-make-tramp-file-name method user host ""))))
4205 (password-cache-remove
4206 (tramp-make-tramp-file-name
4207 (tramp-file-name-method vec)
4208 (tramp-file-name-user vec)
4209 (tramp-file-name-host vec)
4210 "")))
4211 4209
4212;; Snarfed code from time-date.el and parse-time.el 4210;; Snarfed code from time-date.el and parse-time.el
4213 4211