]> git.eshelyaron.com Git - emacs.git/commitdiff
Fix Tramp error on macOS
authorMichael Albinus <michael.albinus@gmx.de>
Thu, 27 Jul 2023 07:30:41 +0000 (09:30 +0200)
committerMichael Albinus <michael.albinus@gmx.de>
Thu, 27 Jul 2023 07:30:41 +0000 (09:30 +0200)
* lisp/net/tramp-sh.el (tramp-ssh-controlmaster-options):
Don't use an absolute ControlPath on macOS.  (Bug#64880)

lisp/net/tramp-sh.el

index f2cbb74acd2242e140edf4aa637b74f9754544a5..3ab58c2722efd7b2576905e5b3fe18f20ff18e42 100644 (file)
@@ -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))