(tramp-copy-keep-date t)))
;;;###tramp-autoload
(add-to-list 'tramp-methods
- `("scp"
+ '("scp"
(tramp-login-program "ssh")
- (tramp-login-args (("-l" "%u") ("-p" "%p")
- ,tramp-ssh-controlmaster-template
+ (tramp-login-args (("-l" "%u") ("-p" "%p") ("%c")
("-e" "none") ("%h")))
(tramp-async-args (("-q")))
(tramp-remote-shell "/bin/sh")
(tramp-remote-shell-args ("-c"))
(tramp-copy-program "scp")
- (tramp-copy-args (("-P" "%p") ("-p" "%k") ("-q") ("-r")
- ,tramp-ssh-controlmaster-template))
+ (tramp-copy-args (("-P" "%p") ("-p" "%k") ("-q") ("-r") ("%c")))
(tramp-copy-keep-date t)
(tramp-copy-recursive t)
(tramp-gw-args (("-o" "GlobalKnownHostsFile=/dev/null")
(tramp-default-port 22)))
;;;###tramp-autoload
(add-to-list 'tramp-methods
- `("scp1"
+ '("scp1"
(tramp-login-program "ssh")
- (tramp-login-args (("-l" "%u") ("-p" "%p")
- ,tramp-ssh-controlmaster-template
+ (tramp-login-args (("-l" "%u") ("-p" "%p") ("%c")
("-1") ("-e" "none") ("%h")))
(tramp-async-args (("-q")))
(tramp-remote-shell "/bin/sh")
(tramp-remote-shell-args ("-c"))
(tramp-copy-program "scp")
- (tramp-copy-args (("-1") ("-P" "%p") ("-p" "%k") ("-q") ("-r")
- ,tramp-ssh-controlmaster-template))
+ (tramp-copy-args (("-1") ("-P" "%p") ("-p" "%k")
+ ("-q") ("-r") ("%c")))
(tramp-copy-keep-date t)
(tramp-copy-recursive t)
(tramp-gw-args (("-o" "GlobalKnownHostsFile=/dev/null")
(tramp-default-port 22)))
;;;###tramp-autoload
(add-to-list 'tramp-methods
- `("scp2"
+ '("scp2"
(tramp-login-program "ssh")
- (tramp-login-args (("-l" "%u") ("-p" "%p")
- ,tramp-ssh-controlmaster-template
+ (tramp-login-args (("-l" "%u") ("-p" "%p") ("%c")
("-2") ("-e" "none") ("%h")))
(tramp-async-args (("-q")))
(tramp-remote-shell "/bin/sh")
(tramp-remote-shell-args ("-c"))
(tramp-copy-program "scp")
- (tramp-copy-args (("-2") ("-P" "%p") ("-p" "%k") ("-q") ("-r")
- ,tramp-ssh-controlmaster-template))
+ (tramp-copy-args (("-2") ("-P" "%p") ("-p" "%k")
+ ("-q") ("-r") ("%c")))
(tramp-copy-keep-date t)
(tramp-copy-recursive t)
(tramp-gw-args (("-o" "GlobalKnownHostsFile=/dev/null")
(tramp-default-port 22)))
;;;###tramp-autoload
(add-to-list 'tramp-methods
- `("scpx"
+ '("scpx"
(tramp-login-program "ssh")
- (tramp-login-args (("-l" "%u") ("-p" "%p")
- ,tramp-ssh-controlmaster-template
+ (tramp-login-args (("-l" "%u") ("-p" "%p") ("%c")
("-e" "none") ("-t" "-t") ("%h") ("/bin/sh")))
(tramp-async-args (("-q")))
(tramp-remote-shell "/bin/sh")
(tramp-remote-shell-args ("-c"))
(tramp-copy-program "scp")
- (tramp-copy-args (("-P" "%p") ("-p" "%k") ("-q") ("-r")
- ,tramp-ssh-controlmaster-template))
+ (tramp-copy-args (("-P" "%p") ("-p" "%k")
+ ("-q") ("-r") ("%c")))
(tramp-copy-keep-date t)
(tramp-copy-recursive t)
(tramp-gw-args (("-o" "GlobalKnownHostsFile=/dev/null")
(tramp-default-port 22)))
;;;###tramp-autoload
(add-to-list 'tramp-methods
- `("sftp"
+ '("sftp"
(tramp-login-program "ssh")
- (tramp-login-args (("-l" "%u") ("-p" "%p")
- ,tramp-ssh-controlmaster-template
+ (tramp-login-args (("-l" "%u") ("-p" "%p") ("%c")
("-e" "none") ("%h")))
(tramp-async-args (("-q")))
(tramp-remote-shell "/bin/sh")
(tramp-remote-shell-args ("-c"))
(tramp-copy-program "sftp")
- (tramp-copy-args ,tramp-ssh-controlmaster-template)))
+ (tramp-copy-args ("%c"))))
;;;###tramp-autoload
(add-to-list 'tramp-methods
- `("rsync"
+ '("rsync"
(tramp-login-program "ssh")
- (tramp-login-args (("-l" "%u") ("-p" "%p")
- ,tramp-ssh-controlmaster-template
+ (tramp-login-args (("-l" "%u") ("-p" "%p") ("%c")
("-e" "none") ("%h")))
(tramp-async-args (("-q")))
(tramp-remote-shell "/bin/sh")
(tramp-remote-shell-args ("-c"))
(tramp-copy-program "rsync")
(tramp-copy-args (("-t" "%k") ("-r")))
- (tramp-copy-env (("RSYNC_RSH")
- (,(mapconcat
- 'identity
- (append
- '("ssh") tramp-ssh-controlmaster-template)
- " "))))
+ (tramp-copy-env (("RSYNC_RSH") ("ssh" "%c")))
(tramp-copy-keep-date t)
(tramp-copy-keep-tmpfile t)
(tramp-copy-recursive t)))
(tramp-remote-shell-args ("-c"))))
;;;###tramp-autoload
(add-to-list 'tramp-methods
- `("ssh"
+ '("ssh"
(tramp-login-program "ssh")
- (tramp-login-args (("-l" "%u") ("-p" "%p")
- ,tramp-ssh-controlmaster-template
+ (tramp-login-args (("-l" "%u") ("-p" "%p") ("%c")
("-e" "none") ("%h")))
(tramp-async-args (("-q")))
(tramp-remote-shell "/bin/sh")
(tramp-default-port 22)))
;;;###tramp-autoload
(add-to-list 'tramp-methods
- `("ssh1"
+ '("ssh1"
(tramp-login-program "ssh")
- (tramp-login-args (("-l" "%u") ("-p" "%p")
- ,tramp-ssh-controlmaster-template
+ (tramp-login-args (("-l" "%u") ("-p" "%p") ("%c")
("-1") ("-e" "none") ("%h")))
(tramp-async-args (("-q")))
(tramp-remote-shell "/bin/sh")
(tramp-default-port 22)))
;;;###tramp-autoload
(add-to-list 'tramp-methods
- `("ssh2"
+ '("ssh2"
(tramp-login-program "ssh")
- (tramp-login-args (("-l" "%u") ("-p" "%p")
- ,tramp-ssh-controlmaster-template
+ (tramp-login-args (("-l" "%u") ("-p" "%p") ("%c")
("-2") ("-e" "none") ("%h")))
(tramp-async-args (("-q")))
(tramp-remote-shell "/bin/sh")
(tramp-default-port 22)))
;;;###tramp-autoload
(add-to-list 'tramp-methods
- `("sshx"
+ '("sshx"
(tramp-login-program "ssh")
- (tramp-login-args (("-l" "%u") ("-p" "%p")
- ,tramp-ssh-controlmaster-template
+ (tramp-login-args (("-l" "%u") ("-p" "%p") ("%c")
("-e" "none") ("-t" "-t") ("%h") ("/bin/sh")))
(tramp-async-args (("-q")))
(tramp-remote-shell "/bin/sh")
(t2 (tramp-tramp-file-p newname))
(orig-vec (tramp-dissect-file-name (if t1 filename newname)))
copy-program copy-args copy-env copy-keep-date port spec
- source target)
+ options source target)
(with-parsed-tramp-file-name (if t1 filename newname) nil
(if (and t1 t2)
user (or user "")
port (or port "")
spec (format-spec-make
- ?h host ?u user ?p port
?t (tramp-get-connection-property
- (tramp-get-connection-process v) "temp-file" "")
+ (tramp-get-connection-process v) "temp-file" ""))
+ options (format-spec tramp-ssh-controlmaster-options spec)
+ spec (format-spec-make
+ ?h host ?u user ?p port ?c options
?k (if keep-date " " ""))
copy-program (tramp-get-method-parameter
method 'tramp-copy-program)
(setenv "PROMPT_COMMAND")
(setenv "PS1" tramp-initial-end-of-output)
(let* ((target-alist (tramp-compute-multi-hops vec))
+ ;; We will apply `tramp-ssh-controlmaster-options'
+ ;; only for the first hop.
+ (options tramp-ssh-controlmaster-options)
(process-connection-type tramp-process-connection-type)
(process-adaptive-read-buffering nil)
(coding-system-for-read nil)
l-host (or l-host "")
l-user (or l-user "")
l-port (or l-port "")
+ spec (format-spec-make ?t tmpfile)
+ options (format-spec options spec)
spec (format-spec-make
- ?h l-host ?u l-user ?p l-port ?t tmpfile)
+ ?h l-host ?u l-user ?p l-port ?c options)
command
(concat
;; We do not want to see the trailing local
(tramp-message
vec 3 "Found remote shell prompt on `%s'" l-host))
;; Next hop.
- (setq target-alist (cdr target-alist)))
+ (setq options ""
+ target-alist (cdr target-alist)))
;; Make initial shell settings.
(tramp-open-connection-setup-interactive-shell p vec))))
argument. By this, arguments like (\"-l\" \"%u\") are optional.
\"%t\" is replaced by the temporary file name produced with
`tramp-make-tramp-temp-file'. \"%k\" indicates the keep-date
- parameter of a program, if exists.
+ parameter of a program, if exists. \"%c\" adds additional
+ `tramp-ssh-controlmaster-options' options for the first hop.
* `tramp-async-args'
When an asynchronous process is started, we know already that
the connection works. Therefore, we can pass additional
useful only in combination with `tramp-default-proxies-alist'.")
;;;###tramp-autoload
-(defconst tramp-ssh-controlmaster-template
- (let (result)
+(defconst tramp-ssh-controlmaster-options
+ (let ((result ""))
(ignore-errors
(with-temp-buffer
(call-process "ssh" nil t nil "-o" "ControlMaster")
(goto-char (point-min))
(when (search-forward-regexp "Missing ControlMaster argument" nil t)
- (setq result
- '("-o" "ControlPath=%t.%%r@%%h:%%p"
- "-o" "ControlMaster=auto"))))
+ (setq result "-o ControlPath=%t.%%r@%%h:%%p -o ControlMaster=auto")))
(when result
(with-temp-buffer
(call-process "ssh" nil t nil "-o" "ControlPersist")
(goto-char (point-min))
(when (search-forward-regexp "Missing ControlPersist argument" nil t)
- (setq result (append result '("-o" "ControlPersist=no")))))))
+ (setq result (concat result " -o ControlPersist=no"))))))
result)
"Call ssh to detect whether it supports the Control* arguments.
-Return a template to be used in `tramp-methods'.")
+Return a string to be used in `tramp-methods'.")
(defcustom tramp-default-method
;; An external copy method seems to be preferred, because it performs
(getenv "SSH_AUTH_SOCK")
(getenv "SSH_AGENT_PID")
;; We could reuse the connection.
- tramp-ssh-controlmaster-template)
+ (> (length tramp-ssh-controlmaster-options) 0))
"scp"
"ssh"))
;; Fallback.