aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--doc/misc/tramp.texi10
-rw-r--r--lisp/net/tramp-gvfs.el3
-rw-r--r--lisp/net/tramp-sh.el12
-rw-r--r--lisp/net/tramp-smb.el20
-rw-r--r--lisp/net/tramp.el30
5 files changed, 56 insertions, 19 deletions
diff --git a/doc/misc/tramp.texi b/doc/misc/tramp.texi
index 4ca393256f6..38b63715b51 100644
--- a/doc/misc/tramp.texi
+++ b/doc/misc/tramp.texi
@@ -1503,9 +1503,15 @@ machine melancholia port scp login daniel password geheim
1503 1503
1504The port can take any @value{tramp} method (@pxref{Inline methods}, 1504The port can take any @value{tramp} method (@pxref{Inline methods},
1505@pxref{External methods}). Omitting port values matches all 1505@pxref{External methods}). Omitting port values matches all
1506@value{tramp} methods. 1506@value{tramp} methods. Domain and ports, as used in @value{tramp}
1507file name syntax, must be appended to the machine and login items:
1507 1508
1508Setting @code{auth-source-debug} to @code{t} to debug messages. 1509@example
1510machine melancholia#4711 port davs login daniel%DOMAIN password geheim
1511@end example
1512
1513@vindex auth-source-debug
1514Set @code{auth-source-debug} to @code{t} to debug messages.
1509 1515
1510 1516
1511@anchor{Caching passwords} 1517@anchor{Caching passwords}
diff --git a/lisp/net/tramp-gvfs.el b/lisp/net/tramp-gvfs.el
index 7aac7c66e37..859809c00a8 100644
--- a/lisp/net/tramp-gvfs.el
+++ b/lisp/net/tramp-gvfs.el
@@ -1299,9 +1299,12 @@ ADDRESS can have the form \"xx:xx:xx:xx:xx:xx\" or \"[xx:xx:xx:xx:xx:xx]\"."
1299 (unless (tramp-get-connection-property l "first-password-request" nil) 1299 (unless (tramp-get-connection-property l "first-password-request" nil)
1300 (tramp-clear-passwd l)) 1300 (tramp-clear-passwd l))
1301 1301
1302 ;; Set variables for computing the prompt for reading password.
1302 (setq tramp-current-method l-method 1303 (setq tramp-current-method l-method
1303 tramp-current-user user 1304 tramp-current-user user
1305 tramp-current-domain l-domain
1304 tramp-current-host l-host 1306 tramp-current-host l-host
1307 tramp-current-port l-port
1305 password (tramp-read-passwd 1308 password (tramp-read-passwd
1306 (tramp-get-connection-process l) pw-prompt)) 1309 (tramp-get-connection-process l) pw-prompt))
1307 1310
diff --git a/lisp/net/tramp-sh.el b/lisp/net/tramp-sh.el
index b2d70fe11ca..f66dc7a7e22 100644
--- a/lisp/net/tramp-sh.el
+++ b/lisp/net/tramp-sh.el
@@ -2345,13 +2345,14 @@ The method used must be an out-of-band method."
2345 (expand-file-name ".." tmpfile) 'recursive) 2345 (expand-file-name ".." tmpfile) 'recursive)
2346 (delete-file tmpfile))))) 2346 (delete-file tmpfile)))))
2347 2347
2348 ;; Set variables for computing the prompt for reading 2348 ;; Set variables for computing the prompt for reading password.
2349 ;; password.
2350 (setq tramp-current-method (tramp-file-name-method v) 2349 (setq tramp-current-method (tramp-file-name-method v)
2351 tramp-current-user (or (tramp-file-name-user v) 2350 tramp-current-user (or (tramp-file-name-user v)
2352 (tramp-get-connection-property 2351 (tramp-get-connection-property
2353 v "login-as" nil)) 2352 v "login-as" nil))
2354 tramp-current-host (tramp-file-name-host v)) 2353 tramp-current-domain (tramp-file-name-domain v)
2354 tramp-current-host (tramp-file-name-host v)
2355 tramp-current-port (tramp-file-name-port v))
2355 2356
2356 ;; Check which ones of source and target are Tramp files. 2357 ;; Check which ones of source and target are Tramp files.
2357 (setq source (funcall 2358 (setq source (funcall
@@ -4719,6 +4720,7 @@ connection if a previous connection has died for some reason."
4719 (let* ((hop (car target-alist)) 4720 (let* ((hop (car target-alist))
4720 (l-method (tramp-file-name-method hop)) 4721 (l-method (tramp-file-name-method hop))
4721 (l-user (tramp-file-name-user hop)) 4722 (l-user (tramp-file-name-user hop))
4723 (l-domain (tramp-file-name-domain hop))
4722 (l-host (tramp-file-name-host hop)) 4724 (l-host (tramp-file-name-host hop))
4723 (l-port (tramp-file-name-port hop)) 4725 (l-port (tramp-file-name-port hop))
4724 (login-program 4726 (login-program
@@ -4764,7 +4766,9 @@ connection if a previous connection has died for some reason."
4764 ;; reading password. 4766 ;; reading password.
4765 (setq tramp-current-method l-method 4767 (setq tramp-current-method l-method
4766 tramp-current-user l-user 4768 tramp-current-user l-user
4767 tramp-current-host l-host) 4769 tramp-current-domain l-domain
4770 tramp-current-host l-host
4771 tramp-current-port l-port)
4768 4772
4769 ;; Add login environment. 4773 ;; Add login environment.
4770 (when login-env 4774 (when login-env
diff --git a/lisp/net/tramp-smb.el b/lisp/net/tramp-smb.el
index 9ac2fc6670e..1aadd14fb41 100644
--- a/lisp/net/tramp-smb.el
+++ b/lisp/net/tramp-smb.el
@@ -439,9 +439,12 @@ pass to the OPERATION."
439 (if (not (file-directory-p newname)) 439 (if (not (file-directory-p newname))
440 (make-directory newname parents)) 440 (make-directory newname parents))
441 441
442 ;; Set variables for computing the prompt for reading password.
442 (setq tramp-current-method method 443 (setq tramp-current-method method
443 tramp-current-user user 444 tramp-current-user user
444 tramp-current-host host) 445 tramp-current-domain domain
446 tramp-current-host host
447 tramp-current-port port)
445 448
446 (let* ((share (tramp-smb-get-share v)) 449 (let* ((share (tramp-smb-get-share v))
447 (localname (file-name-as-directory 450 (localname (file-name-as-directory
@@ -729,10 +732,12 @@ PRESERVE-UID-GID and PRESERVE-EXTENDED-ATTRIBUTES are completely ignored."
729 (with-parsed-tramp-file-name filename nil 732 (with-parsed-tramp-file-name filename nil
730 (with-tramp-file-property v localname "file-acl" 733 (with-tramp-file-property v localname "file-acl"
731 (when (executable-find tramp-smb-acl-program) 734 (when (executable-find tramp-smb-acl-program)
732 735 ;; Set variables for computing the prompt for reading password.
733 (setq tramp-current-method method 736 (setq tramp-current-method method
734 tramp-current-user user 737 tramp-current-user user
735 tramp-current-host host) 738 tramp-current-domain domain
739 tramp-current-host host
740 tramp-current-port port)
736 741
737 (let* ((share (tramp-smb-get-share v)) 742 (let* ((share (tramp-smb-get-share v))
738 (localname (replace-regexp-in-string 743 (localname (replace-regexp-in-string
@@ -1320,9 +1325,12 @@ target of the symlink differ."
1320 (ignore-errors 1325 (ignore-errors
1321 (with-parsed-tramp-file-name filename nil 1326 (with-parsed-tramp-file-name filename nil
1322 (when (and (stringp acl-string) (executable-find tramp-smb-acl-program)) 1327 (when (and (stringp acl-string) (executable-find tramp-smb-acl-program))
1328 ;; Set variables for computing the prompt for reading password.
1323 (setq tramp-current-method method 1329 (setq tramp-current-method method
1324 tramp-current-user user 1330 tramp-current-user user
1325 tramp-current-host host) 1331 tramp-current-domain domain
1332 tramp-current-host host
1333 tramp-current-port port)
1326 (tramp-set-file-property v localname "file-acl" 'undef) 1334 (tramp-set-file-property v localname "file-acl" 'undef)
1327 1335
1328 (let* ((share (tramp-smb-get-share v)) 1336 (let* ((share (tramp-smb-get-share v))
@@ -1876,7 +1884,9 @@ If ARGUMENT is non-nil, use it as argument for
1876 ;; Set variables for computing the prompt for reading password. 1884 ;; Set variables for computing the prompt for reading password.
1877 (setq tramp-current-method tramp-smb-method 1885 (setq tramp-current-method tramp-smb-method
1878 tramp-current-user user 1886 tramp-current-user user
1879 tramp-current-host host) 1887 tramp-current-domain domain
1888 tramp-current-host host
1889 tramp-current-port port)
1880 1890
1881 (condition-case err 1891 (condition-case err
1882 (let (tramp-message-show-message) 1892 (let (tramp-message-show-message)
diff --git a/lisp/net/tramp.el b/lisp/net/tramp.el
index 8758fb61e4a..710aa38b589 100644
--- a/lisp/net/tramp.el
+++ b/lisp/net/tramp.el
@@ -3550,13 +3550,13 @@ The terminal type can be configured with `tramp-terminal-type'."
3550PROC and VEC indicate the remote connection to be used. POS, if 3550PROC and VEC indicate the remote connection to be used. POS, if
3551set, is the starting point of the region to be deleted in the 3551set, is the starting point of the region to be deleted in the
3552connection buffer." 3552connection buffer."
3553 ;; Enable `auth-source'. We must use tramp-current-* variables in 3553 ;; Enable `auth-source'. We must use `tramp-current-*' variables in
3554 ;; case we have several hops. 3554 ;; case we have several hops.
3555 (tramp-set-connection-property 3555 (tramp-set-connection-property
3556 (tramp-dissect-file-name 3556 (make-tramp-file-name
3557 (tramp-make-tramp-file-name 3557 :method tramp-current-method :user tramp-current-user
3558 tramp-current-method tramp-current-user tramp-current-domain 3558 :domain tramp-current-domain :host tramp-current-host
3559 tramp-current-host tramp-current-port "")) 3559 :port tramp-current-port)
3560 "first-password-request" t) 3560 "first-password-request" t)
3561 (save-restriction 3561 (save-restriction
3562 (with-tramp-progress-reporter 3562 (with-tramp-progress-reporter
@@ -4233,8 +4233,19 @@ Invokes `password-read' if available, `read-passwd' else."
4233 (auth-source-search 4233 (auth-source-search
4234 :max 1 4234 :max 1
4235 (and tramp-current-user :user) 4235 (and tramp-current-user :user)
4236 tramp-current-user 4236 (if tramp-current-domain
4237 :host tramp-current-host 4237 (format
4238 "%s%s%s"
4239 tramp-current-user tramp-prefix-domain-format
4240 tramp-current-domain)
4241 tramp-current-user)
4242 :host
4243 (if tramp-current-port
4244 (format
4245 "%s%s%s"
4246 tramp-current-host tramp-prefix-port-format
4247 tramp-current-port)
4248 tramp-current-host)
4238 :port tramp-current-method 4249 :port tramp-current-method
4239 :require 4250 :require
4240 (cons 4251 (cons
@@ -4260,8 +4271,10 @@ Invokes `password-read' if available, `read-passwd' else."
4260 (let ((method (tramp-file-name-method vec)) 4271 (let ((method (tramp-file-name-method vec))
4261 (user (tramp-file-name-user vec)) 4272 (user (tramp-file-name-user vec))
4262 (domain (tramp-file-name-domain vec)) 4273 (domain (tramp-file-name-domain vec))
4274 (user-domain (tramp-file-name-user-domain vec))
4263 (host (tramp-file-name-host vec)) 4275 (host (tramp-file-name-host vec))
4264 (port (tramp-file-name-port vec)) 4276 (port (tramp-file-name-port vec))
4277 (host-port (tramp-file-name-host-port vec))
4265 (hop (tramp-file-name-hop vec))) 4278 (hop (tramp-file-name-hop vec)))
4266 (when hop 4279 (when hop
4267 ;; Clear also the passwords of the hops. 4280 ;; Clear also the passwords of the hops.
@@ -4273,7 +4286,8 @@ Invokes `password-read' if available, `read-passwd' else."
4273 (concat tramp-postfix-hop-regexp "$") 4286 (concat tramp-postfix-hop-regexp "$")
4274 (tramp-postfix-host-format) hop))))) 4287 (tramp-postfix-host-format) hop)))))
4275 (auth-source-forget 4288 (auth-source-forget
4276 `(:max 1 ,(and user :user) ,user :host ,host :port ,method)) 4289 `(:max 1 ,(and user-domain :user) ,user-domain
4290 :host ,host-port :port ,method))
4277 (password-cache-remove 4291 (password-cache-remove
4278 (tramp-make-tramp-file-name method user domain host port "")))) 4292 (tramp-make-tramp-file-name method user domain host port ""))))
4279 4293