diff options
| author | Michael Albinus | 2019-05-10 14:48:07 +0200 |
|---|---|---|
| committer | Michael Albinus | 2019-05-10 14:48:07 +0200 |
| commit | e8709e790006c75e1c91dbf0d50d5dbc816329f6 (patch) | |
| tree | dc21640a3eaaec0f93bc9d6fb9f3ca889a052798 | |
| parent | 510aa7505fc14e0ebc6a0d220160397f068c5c04 (diff) | |
| download | emacs-e8709e790006c75e1c91dbf0d50d5dbc816329f6.tar.gz emacs-e8709e790006c75e1c91dbf0d50d5dbc816329f6.zip | |
Handle subdomains in Tramp ad-hoc proxies
* lisp/net/tramp-sh.el (tramp-compute-multi-hops): Add proper
regexps to `tramp-default-proxies-alist'.
| -rw-r--r-- | lisp/net/tramp-sh.el | 26 |
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'." | |||
| 4622 | 4622 | ||
| 4623 | ;; Ad-hoc proxy definitions. | 4623 | ;; Ad-hoc proxy definitions. |
| 4624 | (dolist (proxy (reverse (split-string hops tramp-postfix-hop-regexp 'omit))) | 4624 | (dolist (proxy (reverse (split-string hops tramp-postfix-hop-regexp 'omit))) |
| 4625 | (let ((user-domain (tramp-file-name-user-domain item)) | 4625 | (let* ((host-port (tramp-file-name-host-port item)) |
| 4626 | (host-port (tramp-file-name-host-port item)) | 4626 | (user-domain (tramp-file-name-user-domain item)) |
| 4627 | (proxy (concat | 4627 | (proxy (concat |
| 4628 | tramp-prefix-format proxy tramp-postfix-host-format))) | 4628 | tramp-prefix-format proxy tramp-postfix-host-format)) |
| 4629 | (tramp-message | 4629 | (entry |
| 4630 | vec 5 "Add proxy (\"%s\" \"%s\" \"%s\")" | 4630 | (list (and (stringp host-port) |
| 4631 | (and (stringp host-port) (regexp-quote host-port)) | 4631 | (concat "^" (regexp-quote host-port) "$")) |
| 4632 | (and (stringp user-domain) (regexp-quote user-domain)) | 4632 | (and (stringp user-domain) |
| 4633 | proxy) | 4633 | (concat "^" (regexp-quote user-domain) "$")) |
| 4634 | (propertize proxy 'tramp-ad-hoc t)))) | ||
| 4635 | (tramp-message vec 5 "Add %S to `tramp-default-proxies-alist'" entry) | ||
| 4634 | ;; Add the hop. | 4636 | ;; Add the hop. |
| 4635 | (add-to-list | 4637 | (add-to-list 'tramp-default-proxies-alist entry) |
| 4636 | 'tramp-default-proxies-alist | ||
| 4637 | (list (and (stringp host-port) (regexp-quote host-port)) | ||
| 4638 | (and (stringp user-domain) (regexp-quote user-domain)) | ||
| 4639 | (propertize proxy 'tramp-ad-hoc t))) | ||
| 4640 | (setq item (tramp-dissect-file-name proxy)))) | 4638 | (setq item (tramp-dissect-file-name proxy)))) |
| 4641 | ;; Save the new value. | 4639 | ;; Save the new value. |
| 4642 | (when (and hops tramp-save-ad-hoc-proxies) | 4640 | (when (and hops tramp-save-ad-hoc-proxies) |