diff options
| author | Michael Albinus | 2022-01-08 13:38:18 +0100 |
|---|---|---|
| committer | Michael Albinus | 2022-01-08 13:38:18 +0100 |
| commit | 9652736b084a09133e983e204eaa29573c0359cc (patch) | |
| tree | 82b195c80d9d54d03488fe4be82df5c52912ccd6 | |
| parent | a80125ae370e001ffced20a07daea45eddea73c9 (diff) | |
| download | emacs-9652736b084a09133e983e204eaa29573c0359cc.tar.gz emacs-9652736b084a09133e983e204eaa29573c0359cc.zip | |
Adapt Tramp for `auth-info-password'
* lisp/net/tramp-compat.el (tramp-compat-auth-info-password):
New defalias.
* lisp/net/tramp.el (tramp-read-passwd): Use it.
| -rw-r--r-- | lisp/net/tramp-compat.el | 10 | ||||
| -rw-r--r-- | lisp/net/tramp.el | 3 |
2 files changed, 12 insertions, 1 deletions
diff --git a/lisp/net/tramp-compat.el b/lisp/net/tramp-compat.el index 0a45b12a04a..db7e7d67c4d 100644 --- a/lisp/net/tramp-compat.el +++ b/lisp/net/tramp-compat.el | |||
| @@ -283,6 +283,16 @@ CONDITION can also be a list of error conditions." | |||
| 283 | (tramp-error vec tramp-permission-denied file) | 283 | (tramp-error vec tramp-permission-denied file) |
| 284 | (tramp-error vec tramp-permission-denied "Permission denied: %s" file))) | 284 | (tramp-error vec tramp-permission-denied "Permission denied: %s" file))) |
| 285 | 285 | ||
| 286 | ;; Function `auth-info-password' is new in Emacs 29.1. | ||
| 287 | (defalias 'tramp-compat-auth-info-password | ||
| 288 | (if (fboundp 'auth-info-password) | ||
| 289 | #'auth-info-password | ||
| 290 | (lambda (auth-info) | ||
| 291 | (let ((secret (plist-get auth-info :secret))) | ||
| 292 | (while (functionp secret) | ||
| 293 | (setq secret (funcall secret))) | ||
| 294 | secret)))) | ||
| 295 | |||
| 286 | (dolist (elt (all-completions "tramp-compat-" obarray 'functionp)) | 296 | (dolist (elt (all-completions "tramp-compat-" obarray 'functionp)) |
| 287 | (put (intern elt) 'tramp-suppress-trace t)) | 297 | (put (intern elt) 'tramp-suppress-trace t)) |
| 288 | 298 | ||
diff --git a/lisp/net/tramp.el b/lisp/net/tramp.el index fdbb78123df..7d6157ed8c2 100644 --- a/lisp/net/tramp.el +++ b/lisp/net/tramp.el | |||
| @@ -5756,7 +5756,8 @@ Invokes `password-read' if available, `read-passwd' else." | |||
| 5756 | :create t)) | 5756 | :create t)) |
| 5757 | tramp-password-save-function | 5757 | tramp-password-save-function |
| 5758 | (plist-get auth-info :save-function) | 5758 | (plist-get auth-info :save-function) |
| 5759 | auth-passwd (auth-info-password auth-info)))) | 5759 | auth-passwd |
| 5760 | (tramp-compat-auth-info-password auth-info)))) | ||
| 5760 | 5761 | ||
| 5761 | ;; Try the password cache. | 5762 | ;; Try the password cache. |
| 5762 | (progn | 5763 | (progn |