diff options
Diffstat (limited to 'lisp/net/tramp-sh.el')
-rw-r--r-- | lisp/net/tramp-sh.el | 32 |
1 files changed, 19 insertions, 13 deletions
diff --git a/lisp/net/tramp-sh.el b/lisp/net/tramp-sh.el index d0a340a5df7..22d4712985c 100644 --- a/lisp/net/tramp-sh.el +++ b/lisp/net/tramp-sh.el @@ -244,14 +244,14 @@ The string is used in `tramp-methods'.") (add-to-list 'tramp-methods `("telnet" (tramp-login-program "telnet") - (tramp-login-args (("%h") ("%p"))) + (tramp-login-args (("%h") ("%p") ("%n"))) (tramp-remote-shell ,tramp-default-remote-shell) (tramp-remote-shell-login ("-l")) (tramp-remote-shell-args ("-c")))) (add-to-list 'tramp-methods `("nc" (tramp-login-program "telnet") - (tramp-login-args (("%h") ("%p"))) + (tramp-login-args (("%h") ("%p") ("%n"))) (tramp-remote-shell ,tramp-default-remote-shell) (tramp-remote-shell-login ("-l")) (tramp-remote-shell-args ("-c")) @@ -1064,7 +1064,7 @@ component is used as the target of the symlink." (not (yes-or-no-p (format - "File %s already exists; make it a link anyway? " + "File %s already exists; make it a link anyway?" localname))))) (tramp-error v 'file-already-exists localname) (delete-file linkname))) @@ -1073,7 +1073,7 @@ component is used as the target of the symlink." ;; Right, they are on the same host, regardless of user, ;; method, etc. We now make the link on the remote - ;; machine. This will occur as the user that TARGET belongs to. + ;; machine. This will occur as the user that TARGET belongs to. (and (tramp-send-command-and-check v (format "cd %s" (tramp-shell-quote-argument cwd))) (tramp-send-command-and-check @@ -1825,7 +1825,7 @@ ID-FORMAT valid values are `string' and `integer'." (and (numberp ok-if-already-exists) (not (yes-or-no-p (format - "File %s already exists; make it a link anyway? " + "File %s already exists; make it a link anyway?" v2-localname))))) (tramp-error v2 'file-already-exists newname) (delete-file newname))) @@ -2231,7 +2231,7 @@ the uid and gid from FILENAME." ;; Save exit. (ignore-errors (delete-file tmpfile))))))))) - ;; Set the time and mode. Mask possible errors. + ;; Set the time and mode. Mask possible errors. (ignore-errors (when keep-date (tramp-compat-set-file-times @@ -2748,7 +2748,7 @@ the result will be a local, non-Tramp, file name." ;;; Remote commands: -;; We use BUFFER also as connection buffer during setup. Because of +;; We use BUFFER also as connection buffer during setup. Because of ;; this, its original contents must be saved, and restored once ;; connection has been setup. (defun tramp-sh-handle-make-process (&rest args) @@ -3269,7 +3269,7 @@ implementation will be used." (or (eq mustbenew 'excl) (not (y-or-n-p - (format "File %s exists; overwrite anyway? " filename))))) + (format "File %s exists; overwrite anyway?" filename))))) (tramp-error v 'file-already-exists filename)) (let ((file-locked (eq (file-locked-p lockname) t)) @@ -4000,7 +4000,7 @@ Returns the absolute file name of PROGNAME, if found, and nil otherwise. This function expects to be in the right *tramp* buffer." (with-current-buffer (tramp-get-connection-buffer vec) (let (result) - ;; Check whether the executable is in $PATH. "which(1)" does not + ;; Check whether the executable is in $PATH. "which(1)" does not ;; report always a correct error code; therefore we check the ;; number of words it returns. "SunOS 5.10" (and maybe "SunOS ;; 5.11") have problems with this command, we disable the call @@ -4904,6 +4904,8 @@ connection if a previous connection has died for some reason." (tramp-error vec 'file-error "`tramp-encoding-shell' not set")) (let* ((current-host tramp-system-name) (target-alist (tramp-compute-multi-hops vec)) + ;; Needed for `tramp-get-remote-null-device'. + (previous-hop nil) ;; We will apply `tramp-ssh-controlmaster-options' ;; only for the first hop. (options (tramp-ssh-controlmaster-options vec)) @@ -5016,6 +5018,8 @@ connection if a previous connection has died for some reason." hop 'tramp-login-args ?h (or l-host "") ?u (or l-user "") ?p (or l-port "") ?c (format-spec options (format-spec-make ?t tmpfile)) + ?n (concat + "2>" (tramp-get-remote-null-device previous-hop)) ?l (concat remote-shell " " extra-args " -i")) ;; A restricted shell does not allow "exec". (when r-shell '("&&" "exit" "||" "exit"))) @@ -5031,10 +5035,12 @@ connection if a previous connection has died for some reason." tramp-actions-before-shell (or connection-timeout tramp-connection-timeout)) (tramp-message - vec 3 "Found remote shell prompt on `%s'" l-host)) - ;; Next hop. - (setq options "" - target-alist (cdr target-alist))) + vec 3 "Found remote shell prompt on `%s'" l-host) + + ;; Next hop. + (setq options "" + target-alist (cdr target-alist) + previous-hop hop))) ;; Activate session timeout. (when (tramp-get-connection-property p "session-timeout" nil) |