summaryrefslogtreecommitdiff
path: root/lisp/net
diff options
context:
space:
mode:
authorMichael Albinus <michael.albinus@gmx.de>2019-05-10 14:48:07 +0200
committerMichael Albinus <michael.albinus@gmx.de>2019-05-10 14:48:07 +0200
commite8709e790006c75e1c91dbf0d50d5dbc816329f6 (patch)
treedc21640a3eaaec0f93bc9d6fb9f3ca889a052798 /lisp/net
parent510aa7505fc14e0ebc6a0d220160397f068c5c04 (diff)
downloademacs-e8709e790006c75e1c91dbf0d50d5dbc816329f6.tar.gz
Handle subdomains in Tramp ad-hoc proxies
* lisp/net/tramp-sh.el (tramp-compute-multi-hops): Add proper regexps to `tramp-default-proxies-alist'.
Diffstat (limited to 'lisp/net')
-rw-r--r--lisp/net/tramp-sh.el26
1 files changed, 12 insertions, 14 deletions
diff --git a/lisp/net/tramp-sh.el b/lisp/net/tramp-sh.el
index b9df4033098..95fa61af983 100644
--- a/lisp/net/tramp-sh.el
+++ b/lisp/net/tramp-sh.el
@@ -4622,21 +4622,19 @@ Goes through the list `tramp-inline-compress-commands'."
;; Ad-hoc proxy definitions.
(dolist (proxy (reverse (split-string hops tramp-postfix-hop-regexp 'omit)))
- (let ((user-domain (tramp-file-name-user-domain item))
- (host-port (tramp-file-name-host-port item))
- (proxy (concat
- tramp-prefix-format proxy tramp-postfix-host-format)))
- (tramp-message
- vec 5 "Add proxy (\"%s\" \"%s\" \"%s\")"
- (and (stringp host-port) (regexp-quote host-port))
- (and (stringp user-domain) (regexp-quote user-domain))
- proxy)
+ (let* ((host-port (tramp-file-name-host-port item))
+ (user-domain (tramp-file-name-user-domain item))
+ (proxy (concat
+ tramp-prefix-format proxy tramp-postfix-host-format))
+ (entry
+ (list (and (stringp host-port)
+ (concat "^" (regexp-quote host-port) "$"))
+ (and (stringp user-domain)
+ (concat "^" (regexp-quote user-domain) "$"))
+ (propertize proxy 'tramp-ad-hoc t))))
+ (tramp-message vec 5 "Add %S to `tramp-default-proxies-alist'" entry)
;; Add the hop.
- (add-to-list
- 'tramp-default-proxies-alist
- (list (and (stringp host-port) (regexp-quote host-port))
- (and (stringp user-domain) (regexp-quote user-domain))
- (propertize proxy 'tramp-ad-hoc t)))
+ (add-to-list 'tramp-default-proxies-alist entry)
(setq item (tramp-dissect-file-name proxy))))
;; Save the new value.
(when (and hops tramp-save-ad-hoc-proxies)