mirror of
git://git.sv.gnu.org/emacs.git
synced 2025-12-22 05:31:01 -08:00
Follow OpenSSH changes in Tramp
* lisp/net/tramp-sh.el (tramp-ssh-controlmaster-options): Reimplement. OpenSSH has changed its diagnostics messages.
This commit is contained in:
parent
e86eae21a9
commit
a50f8dec09
1 changed files with 25 additions and 28 deletions
|
|
@ -4753,36 +4753,33 @@ Goes through the list `tramp-inline-compress-commands'."
|
||||||
(t (setq tramp-ssh-controlmaster-options "")
|
(t (setq tramp-ssh-controlmaster-options "")
|
||||||
(let ((case-fold-search t))
|
(let ((case-fold-search t))
|
||||||
(ignore-errors
|
(ignore-errors
|
||||||
(when (executable-find "ssh")
|
|
||||||
(with-tramp-progress-reporter
|
(with-tramp-progress-reporter
|
||||||
vec 4 "Computing ControlMaster options"
|
vec 4 "Computing ControlMaster options"
|
||||||
(with-temp-buffer
|
;; We use a non-existing IP address, in order to avoid
|
||||||
(tramp-call-process vec "ssh" nil t nil "-o" "ControlMaster")
|
;; useless connections, and DNS timeouts.
|
||||||
(goto-char (point-min))
|
(when (zerop
|
||||||
(when (search-forward-regexp "\\(missing\\|no\\).+argument" nil t)
|
|
||||||
(setq tramp-ssh-controlmaster-options
|
|
||||||
"-o ControlMaster=auto")))
|
|
||||||
(unless (zerop (length tramp-ssh-controlmaster-options))
|
|
||||||
(with-temp-buffer
|
|
||||||
;; We use a non-existing IP address, in order to
|
|
||||||
;; avoid useless connections, and DNS timeouts.
|
|
||||||
;; Setting ConnectTimeout is needed since OpenSSH 7.
|
|
||||||
(tramp-call-process
|
(tramp-call-process
|
||||||
vec "ssh" nil t nil
|
vec "ssh" nil nil nil
|
||||||
"-o" "ConnectTimeout=1" "-o" "ControlPath=%C" "0.0.0.1")
|
"-G" "-o" "ControlMaster=auto" "0.0.0.1"))
|
||||||
(goto-char (point-min))
|
(setq tramp-ssh-controlmaster-options
|
||||||
|
"-o ControlMaster=auto")
|
||||||
|
(if (zerop
|
||||||
|
(tramp-call-process
|
||||||
|
vec "ssh" nil nil nil
|
||||||
|
"-G" "-o" "ControlPath='tramp.%C'" "0.0.0.1"))
|
||||||
(setq tramp-ssh-controlmaster-options
|
(setq tramp-ssh-controlmaster-options
|
||||||
(concat tramp-ssh-controlmaster-options
|
(concat tramp-ssh-controlmaster-options
|
||||||
(if (search-forward-regexp "unknown.+key" nil t)
|
" -o ControlPath='tramp.%%C'"))
|
||||||
" -o ControlPath='tramp.%%r@%%h:%%p'"
|
|
||||||
" -o ControlPath='tramp.%%C'"))))
|
|
||||||
(with-temp-buffer
|
|
||||||
(tramp-call-process vec "ssh" nil t nil "-o" "ControlPersist")
|
|
||||||
(goto-char (point-min))
|
|
||||||
(when (search-forward-regexp "missing.+argument" nil t)
|
|
||||||
(setq tramp-ssh-controlmaster-options
|
(setq tramp-ssh-controlmaster-options
|
||||||
(concat tramp-ssh-controlmaster-options
|
(concat tramp-ssh-controlmaster-options
|
||||||
" -o ControlPersist=no")))))))))
|
" -o ControlPath='tramp.%%r@%%h:%%p'")))
|
||||||
|
(when (zerop
|
||||||
|
(tramp-call-process
|
||||||
|
vec "ssh" nil nil nil
|
||||||
|
"-G" "-o" "ControlPersist=no" "0.0.0.1"))
|
||||||
|
(setq tramp-ssh-controlmaster-options
|
||||||
|
(concat tramp-ssh-controlmaster-options
|
||||||
|
" -o ControlPersist=no")))))))
|
||||||
tramp-ssh-controlmaster-options)))
|
tramp-ssh-controlmaster-options)))
|
||||||
|
|
||||||
(defun tramp-scp-strict-file-name-checking (vec)
|
(defun tramp-scp-strict-file-name-checking (vec)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue