summaryrefslogtreecommitdiff
path: root/lisp
diff options
context:
space:
mode:
Diffstat (limited to 'lisp')
-rw-r--r--lisp/net/tramp-compat.el10
-rw-r--r--lisp/net/tramp.el3
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."
(tramp-error vec tramp-permission-denied file)
(tramp-error vec tramp-permission-denied "Permission denied: %s" file)))
+;; Function `auth-info-password' is new in Emacs 29.1.
+(defalias 'tramp-compat-auth-info-password
+ (if (fboundp 'auth-info-password)
+ #'auth-info-password
+ (lambda (auth-info)
+ (let ((secret (plist-get auth-info :secret)))
+ (while (functionp secret)
+ (setq secret (funcall secret)))
+ secret))))
+
(dolist (elt (all-completions "tramp-compat-" obarray 'functionp))
(put (intern elt) 'tramp-suppress-trace t))
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."
:create t))
tramp-password-save-function
(plist-get auth-info :save-function)
- auth-passwd (auth-info-password auth-info))))
+ auth-passwd
+ (tramp-compat-auth-info-password auth-info))))
;; Try the password cache.
(progn