diff options
| author | Michael Albinus | 2022-02-26 12:51:26 +0100 |
|---|---|---|
| committer | Michael Albinus | 2022-02-26 12:51:26 +0100 |
| commit | a50f8dec092ecc82814fd21ed2cd1bfdc693655d (patch) | |
| tree | 4cfd72c342b70280055a4d80a9dc267a96699342 | |
| parent | e86eae21a9b72a751d2dc3419b56debfce2022a9 (diff) | |
| download | emacs-a50f8dec092ecc82814fd21ed2cd1bfdc693655d.tar.gz emacs-a50f8dec092ecc82814fd21ed2cd1bfdc693655d.zip | |
Follow OpenSSH changes in Tramp
* lisp/net/tramp-sh.el (tramp-ssh-controlmaster-options):
Reimplement. OpenSSH has changed its diagnostics messages.
| -rw-r--r-- | lisp/net/tramp-sh.el | 53 |
1 files changed, 25 insertions, 28 deletions
diff --git a/lisp/net/tramp-sh.el b/lisp/net/tramp-sh.el index 80fd99e7f65..de4d579740a 100644 --- a/lisp/net/tramp-sh.el +++ b/lisp/net/tramp-sh.el | |||
| @@ -4753,36 +4753,33 @@ Goes through the list `tramp-inline-compress-commands'." | |||
| 4753 | (t (setq tramp-ssh-controlmaster-options "") | 4753 | (t (setq tramp-ssh-controlmaster-options "") |
| 4754 | (let ((case-fold-search t)) | 4754 | (let ((case-fold-search t)) |
| 4755 | (ignore-errors | 4755 | (ignore-errors |
| 4756 | (when (executable-find "ssh") | 4756 | (with-tramp-progress-reporter |
| 4757 | (with-tramp-progress-reporter | 4757 | vec 4 "Computing ControlMaster options" |
| 4758 | vec 4 "Computing ControlMaster options" | 4758 | ;; We use a non-existing IP address, in order to avoid |
| 4759 | (with-temp-buffer | 4759 | ;; useless connections, and DNS timeouts. |
| 4760 | (tramp-call-process vec "ssh" nil t nil "-o" "ControlMaster") | 4760 | (when (zerop |
| 4761 | (goto-char (point-min)) | 4761 | (tramp-call-process |
| 4762 | (when (search-forward-regexp "\\(missing\\|no\\).+argument" nil t) | 4762 | vec "ssh" nil nil nil |
| 4763 | (setq tramp-ssh-controlmaster-options | 4763 | "-G" "-o" "ControlMaster=auto" "0.0.0.1")) |
| 4764 | "-o ControlMaster=auto"))) | 4764 | (setq tramp-ssh-controlmaster-options |
| 4765 | (unless (zerop (length tramp-ssh-controlmaster-options)) | 4765 | "-o ControlMaster=auto") |
| 4766 | (with-temp-buffer | 4766 | (if (zerop |
| 4767 | ;; We use a non-existing IP address, in order to | 4767 | (tramp-call-process |
| 4768 | ;; avoid useless connections, and DNS timeouts. | 4768 | vec "ssh" nil nil nil |
| 4769 | ;; Setting ConnectTimeout is needed since OpenSSH 7. | 4769 | "-G" "-o" "ControlPath='tramp.%C'" "0.0.0.1")) |
| 4770 | (tramp-call-process | ||
| 4771 | vec "ssh" nil t nil | ||
| 4772 | "-o" "ConnectTimeout=1" "-o" "ControlPath=%C" "0.0.0.1") | ||
| 4773 | (goto-char (point-min)) | ||
| 4774 | (setq tramp-ssh-controlmaster-options | 4770 | (setq tramp-ssh-controlmaster-options |
| 4775 | (concat tramp-ssh-controlmaster-options | 4771 | (concat tramp-ssh-controlmaster-options |
| 4776 | (if (search-forward-regexp "unknown.+key" nil t) | 4772 | " -o ControlPath='tramp.%%C'")) |
| 4777 | " -o ControlPath='tramp.%%r@%%h:%%p'" | 4773 | (setq tramp-ssh-controlmaster-options |
| 4778 | " -o ControlPath='tramp.%%C'")))) | 4774 | (concat tramp-ssh-controlmaster-options |
| 4779 | (with-temp-buffer | 4775 | " -o ControlPath='tramp.%%r@%%h:%%p'"))) |
| 4780 | (tramp-call-process vec "ssh" nil t nil "-o" "ControlPersist") | 4776 | (when (zerop |
| 4781 | (goto-char (point-min)) | 4777 | (tramp-call-process |
| 4782 | (when (search-forward-regexp "missing.+argument" nil t) | 4778 | vec "ssh" nil nil nil |
| 4783 | (setq tramp-ssh-controlmaster-options | 4779 | "-G" "-o" "ControlPersist=no" "0.0.0.1")) |
| 4784 | (concat tramp-ssh-controlmaster-options | 4780 | (setq tramp-ssh-controlmaster-options |
| 4785 | " -o ControlPersist=no"))))))))) | 4781 | (concat tramp-ssh-controlmaster-options |
| 4782 | " -o ControlPersist=no"))))))) | ||
| 4786 | tramp-ssh-controlmaster-options))) | 4783 | tramp-ssh-controlmaster-options))) |
| 4787 | 4784 | ||
| 4788 | (defun tramp-scp-strict-file-name-checking (vec) | 4785 | (defun tramp-scp-strict-file-name-checking (vec) |