diff options
| author | Michael Albinus | 2015-02-02 10:16:04 +0100 |
|---|---|---|
| committer | Michael Albinus | 2015-02-02 10:16:04 +0100 |
| commit | 50f3811883c7082b3c2a5a10bcfe77a3adfcb6ff (patch) | |
| tree | 38ede30aa0b67f4181d5dd6826ca1cb5b6104dfa | |
| parent | 43b82baa79132b4ad8ae123532c8f49467d93cb1 (diff) | |
| download | emacs-50f3811883c7082b3c2a5a10bcfe77a3adfcb6ff.tar.gz emacs-50f3811883c7082b3c2a5a10bcfe77a3adfcb6ff.zip | |
net/tramp.el (tramp-ssh-controlmaster-options): Use "%C"
Fixes: debbugs:19702
* net/tramp.el (tramp-ssh-controlmaster-options): Use "%C" for
ControlPath if possible.
| -rw-r--r-- | lisp/ChangeLog | 5 | ||||
| -rw-r--r-- | lisp/net/tramp.el | 24 |
2 files changed, 21 insertions, 8 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog index cc42bcecc9c..8ef533e1aa6 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog | |||
| @@ -1,3 +1,8 @@ | |||
| 1 | 2015-02-02 Michael Albinus <michael.albinus@gmx.de> | ||
| 2 | |||
| 3 | * net/tramp.el (tramp-ssh-controlmaster-options): Use "%C" for | ||
| 4 | ControlPath if possible. (Bug#19702) | ||
| 5 | |||
| 1 | 2015-02-02 Glenn Morris <rgm@gnu.org> | 6 | 2015-02-02 Glenn Morris <rgm@gnu.org> |
| 2 | 7 | ||
| 3 | * emacs-lisp/authors.el (authors-obsolete-files-regexps) | 8 | * emacs-lisp/authors.el (authors-obsolete-files-regexps) |
diff --git a/lisp/net/tramp.el b/lisp/net/tramp.el index 3afb487ec3d..c442806b90f 100644 --- a/lisp/net/tramp.el +++ b/lisp/net/tramp.el | |||
| @@ -311,17 +311,25 @@ useful only in combination with `tramp-default-proxies-alist'.") | |||
| 311 | (let ((result "") | 311 | (let ((result "") |
| 312 | (case-fold-search t)) | 312 | (case-fold-search t)) |
| 313 | (ignore-errors | 313 | (ignore-errors |
| 314 | (with-temp-buffer | 314 | (when (executable-find "ssh") |
| 315 | (call-process "ssh" nil t nil "-o" "ControlMaster") | ||
| 316 | (goto-char (point-min)) | ||
| 317 | (when (search-forward-regexp "missing.+argument" nil t) | ||
| 318 | (setq result "-o ControlPath=%t.%%r@%%h:%%p -o ControlMaster=auto"))) | ||
| 319 | (unless (zerop (length result)) | ||
| 320 | (with-temp-buffer | 315 | (with-temp-buffer |
| 321 | (call-process "ssh" nil t nil "-o" "ControlPersist") | 316 | (call-process "ssh" nil t nil "-o" "ControlMaster") |
| 322 | (goto-char (point-min)) | 317 | (goto-char (point-min)) |
| 323 | (when (search-forward-regexp "missing.+argument" nil t) | 318 | (when (search-forward-regexp "missing.+argument" nil t) |
| 324 | (setq result (concat result " -o ControlPersist=no")))))) | 319 | (setq result "-o ControlMaster=auto"))) |
| 320 | (unless (zerop (length result)) | ||
| 321 | (with-temp-buffer | ||
| 322 | (call-process | ||
| 323 | "ssh" nil t nil "-o" "ControlPath=%C" "host.does.not.exist") | ||
| 324 | (goto-char (point-min)) | ||
| 325 | (if (search-forward-regexp "unknown.+key" nil t) | ||
| 326 | (setq result (concat result " -o ControlPath=%t.%%r@%%h:%%p")) | ||
| 327 | (setq result (concat result " -o ControlPath=%t.%%C")))) | ||
| 328 | (with-temp-buffer | ||
| 329 | (call-process "ssh" nil t nil "-o" "ControlPersist") | ||
| 330 | (goto-char (point-min)) | ||
| 331 | (when (search-forward-regexp "missing.+argument" nil t) | ||
| 332 | (setq result (concat result " -o ControlPersist=no"))))))) | ||
| 325 | result) | 333 | result) |
| 326 | "Call ssh to detect whether it supports the Control* arguments. | 334 | "Call ssh to detect whether it supports the Control* arguments. |
| 327 | Return a string to be used in `tramp-methods'.") | 335 | Return a string to be used in `tramp-methods'.") |