From b936ff0963e69d30d77cec5323a95bc2385cf212 Mon Sep 17 00:00:00 2001 From: Michael Albinus Date: Thu, 27 Jul 2023 09:30:41 +0200 Subject: [PATCH] Fix Tramp error on macOS * lisp/net/tramp-sh.el (tramp-ssh-controlmaster-options): Don't use an absolute ControlPath on macOS. (Bug#64880) --- lisp/net/tramp-sh.el | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/lisp/net/tramp-sh.el b/lisp/net/tramp-sh.el index f2cbb74acd2..3ab58c2722e 100644 --- a/lisp/net/tramp-sh.el +++ b/lisp/net/tramp-sh.el @@ -4867,12 +4867,17 @@ Goes through the list `tramp-inline-compress-commands'." " -o ControlPath=" (if (eq tramp-use-connection-share 'suppress) "none" - ;; Hashed tokens are introduced in OpenSSH 6.7. - (expand-file-name - (if (tramp-ssh-option-exists-p vec "ControlPath=tramp.%C") - "tramp.%%C" "tramp.%%r@%%h:%%p") - (or small-temporary-file-directory - tramp-compat-temporary-file-directory))) + ;; Hashed tokens are introduced in OpenSSH 6.7. On macOS + ;; we cannot use an absolute file name, it is too long. + ;; See Bug#19702. + (if (eq system-type 'darwin) + (if (tramp-ssh-option-exists-p vec "ControlPath=tramp.%C") + "tramp.%%C" "tramp.%%r@%%h:%%p") + (expand-file-name + (if (tramp-ssh-option-exists-p vec "ControlPath=tramp.%C") + "tramp.%%C" "tramp.%%r@%%h:%%p") + (or small-temporary-file-directory + tramp-compat-temporary-file-directory)))) ;; ControlPersist option is introduced in OpenSSH 5.6. (when (and (not (eq tramp-use-connection-share 'suppress)) -- 2.39.2