aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Albinus2018-12-31 15:11:09 +0100
committerMichael Albinus2018-12-31 15:11:09 +0100
commitc5bbf67d5ca36f83f57139f300a76dfc164dffba (patch)
tree4e3f3e34988192c43b6d6b79b701f2304ed4beba
parent792dc36e691b1e4b7735c75d2d402d1b9a8801ce (diff)
downloademacs-c5bbf67d5ca36f83f57139f300a76dfc164dffba.tar.gz
emacs-c5bbf67d5ca36f83f57139f300a76dfc164dffba.zip
Reset `tramp-default-proxies-alist' in case of errors
* lisp/net/tramp-sh.el (tramp-compute-multi-hops): Reset `tramp-default-proxies-alist' in case of errors.
-rw-r--r--lisp/net/tramp-sh.el12
1 files changed, 7 insertions, 5 deletions
diff --git a/lisp/net/tramp-sh.el b/lisp/net/tramp-sh.el
index 991a2102634..06c1c2da830 100644
--- a/lisp/net/tramp-sh.el
+++ b/lisp/net/tramp-sh.el
@@ -4610,7 +4610,8 @@ Goes through the list `tramp-inline-compress-commands'."
4610 4610
4611(defun tramp-compute-multi-hops (vec) 4611(defun tramp-compute-multi-hops (vec)
4612 "Expands VEC according to `tramp-default-proxies-alist'." 4612 "Expands VEC according to `tramp-default-proxies-alist'."
4613 (let ((target-alist `(,vec)) 4613 (let ((saved-tdpa tramp-default-proxies-alist)
4614 (target-alist `(,vec))
4614 (hops (or (tramp-file-name-hop vec) "")) 4615 (hops (or (tramp-file-name-hop vec) ""))
4615 (item vec) 4616 (item vec)
4616 choices proxy) 4617 choices proxy)
@@ -4676,9 +4677,9 @@ Goes through the list `tramp-inline-compress-commands'."
4676 (while (setq item (pop choices)) 4677 (while (setq item (pop choices))
4677 (when (or (not (tramp-get-method-parameter item 'tramp-login-program)) 4678 (when (or (not (tramp-get-method-parameter item 'tramp-login-program))
4678 (tramp-get-method-parameter item 'tramp-copy-program)) 4679 (tramp-get-method-parameter item 'tramp-copy-program))
4679 (tramp-error 4680 (setq tramp-default-proxies-alist saved-tdpa)
4680 vec 'file-error 4681 (tramp-user-error
4681 "Method `%s' is not supported for multi-hops." 4682 vec "Method `%s' is not supported for multi-hops."
4682 (tramp-file-name-method item))))) 4683 (tramp-file-name-method item)))))
4683 4684
4684 ;; Some methods ("su", "sg", "sudo", "doas", "ksu") do not use the 4685 ;; Some methods ("su", "sg", "sudo", "doas", "ksu") do not use the
@@ -4696,8 +4697,9 @@ Goes through the list `tramp-inline-compress-commands'."
4696 '("%h") (tramp-get-method-parameter item 'tramp-login-args)) 4697 '("%h") (tramp-get-method-parameter item 'tramp-login-args))
4697 ;; The host name must match previous hop. 4698 ;; The host name must match previous hop.
4698 (string-match-p previous-host host)) 4699 (string-match-p previous-host host))
4700 (setq tramp-default-proxies-alist saved-tdpa)
4699 (tramp-user-error 4701 (tramp-user-error
4700 item "Host name `%s' does not match `%s'" host previous-host)) 4702 vec "Host name `%s' does not match `%s'" host previous-host))
4701 (setq previous-host (concat "^" (regexp-quote host) "$"))))) 4703 (setq previous-host (concat "^" (regexp-quote host) "$")))))
4702 4704
4703 ;; Result. 4705 ;; Result.