diff options
Diffstat (limited to 'lisp/net/tramp-sh.el')
| -rw-r--r-- | lisp/net/tramp-sh.el | 24 |
1 files changed, 16 insertions, 8 deletions
diff --git a/lisp/net/tramp-sh.el b/lisp/net/tramp-sh.el index 2478253841f..38e19730a6d 100644 --- a/lisp/net/tramp-sh.el +++ b/lisp/net/tramp-sh.el | |||
| @@ -380,7 +380,7 @@ detected as prompt when being sent on echoing hosts, therefore.") | |||
| 380 | (tramp-remote-shell "/bin/sh") | 380 | (tramp-remote-shell "/bin/sh") |
| 381 | (tramp-remote-shell-args ("-c")) | 381 | (tramp-remote-shell-args ("-c")) |
| 382 | (tramp-copy-program "pscp") | 382 | (tramp-copy-program "pscp") |
| 383 | (tramp-copy-args (("-P" "%p") ("-scp") ("-p" "%k") | 383 | (tramp-copy-args (("-l" "%u") ("-P" "%p") ("-scp") ("-p" "%k") |
| 384 | ("-q") ("-r"))) | 384 | ("-q") ("-r"))) |
| 385 | (tramp-copy-keep-date t) | 385 | (tramp-copy-keep-date t) |
| 386 | (tramp-copy-recursive t) | 386 | (tramp-copy-recursive t) |
| @@ -394,7 +394,7 @@ detected as prompt when being sent on echoing hosts, therefore.") | |||
| 394 | (tramp-remote-shell "/bin/sh") | 394 | (tramp-remote-shell "/bin/sh") |
| 395 | (tramp-remote-shell-args ("-c")) | 395 | (tramp-remote-shell-args ("-c")) |
| 396 | (tramp-copy-program "pscp") | 396 | (tramp-copy-program "pscp") |
| 397 | (tramp-copy-args (("-P" "%p") ("-sftp") ("-p" "%k") | 397 | (tramp-copy-args (("-l" "%u") ("-P" "%p") ("-sftp") ("-p" "%k") |
| 398 | ("-q") ("-r"))) | 398 | ("-q") ("-r"))) |
| 399 | (tramp-copy-keep-date t) | 399 | (tramp-copy-keep-date t) |
| 400 | (tramp-copy-recursive t) | 400 | (tramp-copy-recursive t) |
| @@ -419,13 +419,12 @@ detected as prompt when being sent on echoing hosts, therefore.") | |||
| 419 | `(,(concat "\\`" (regexp-opt '("su" "sudo" "ksu")) "\\'") | 419 | `(,(concat "\\`" (regexp-opt '("su" "sudo" "ksu")) "\\'") |
| 420 | nil "root")) | 420 | nil "root")) |
| 421 | ;; Do not add "ssh" based methods, otherwise ~/.ssh/config would be ignored. | 421 | ;; Do not add "ssh" based methods, otherwise ~/.ssh/config would be ignored. |
| 422 | ;; Do not add "plink" based methods, they ask interactively for the user. | ||
| 422 | ;;;###tramp-autoload | 423 | ;;;###tramp-autoload |
| 423 | (add-to-list 'tramp-default-user-alist | 424 | (add-to-list 'tramp-default-user-alist |
| 424 | `(,(concat | 425 | `(,(concat |
| 425 | "\\`" | 426 | "\\`" |
| 426 | (regexp-opt | 427 | (regexp-opt '("rcp" "remcp" "rsh" "telnet" "krlogin" "fcp")) |
| 427 | '("rcp" "remcp" "rsh" "telnet" "krlogin" | ||
| 428 | "plink" "plink1" "pscp" "psftp" "fcp")) | ||
| 429 | "\\'") | 428 | "\\'") |
| 430 | nil ,(user-login-name))) | 429 | nil ,(user-login-name))) |
| 431 | 430 | ||
| @@ -2281,8 +2280,10 @@ The method used must be an out-of-band method." | |||
| 2281 | ;; Set variables for computing the prompt for reading | 2280 | ;; Set variables for computing the prompt for reading |
| 2282 | ;; password. | 2281 | ;; password. |
| 2283 | (setq tramp-current-method (tramp-file-name-method v) | 2282 | (setq tramp-current-method (tramp-file-name-method v) |
| 2284 | tramp-current-user (tramp-file-name-user v) | 2283 | tramp-current-user (or (tramp-file-name-user v) |
| 2285 | tramp-current-host (tramp-file-name-real-host v)) | 2284 | (tramp-get-connection-property |
| 2285 | v "login-as" nil)) | ||
| 2286 | tramp-current-host (tramp-file-name-real-host v)) | ||
| 2286 | 2287 | ||
| 2287 | ;; Expand hops. Might be necessary for gateway methods. | 2288 | ;; Expand hops. Might be necessary for gateway methods. |
| 2288 | (setq v (car (tramp-compute-multi-hops v))) | 2289 | (setq v (car (tramp-compute-multi-hops v))) |
| @@ -2309,8 +2310,15 @@ The method used must be an out-of-band method." | |||
| 2309 | (setq port (string-to-number (match-string 2 host)) | 2310 | (setq port (string-to-number (match-string 2 host)) |
| 2310 | host (string-to-number (match-string 1 host)))) | 2311 | host (string-to-number (match-string 1 host)))) |
| 2311 | 2312 | ||
| 2313 | ;; Check for user. There might be an interactive setting. | ||
| 2314 | (setq user (or (tramp-file-name-user v) | ||
| 2315 | (tramp-get-connection-property v "login-as" nil))) | ||
| 2316 | |||
| 2312 | ;; Compose copy command. | 2317 | ;; Compose copy command. |
| 2313 | (setq spec (format-spec-make | 2318 | (setq host (or host "") |
| 2319 | user (or user "") | ||
| 2320 | port (or port "") | ||
| 2321 | spec (format-spec-make | ||
| 2314 | ?h host ?u user ?p port | 2322 | ?h host ?u user ?p port |
| 2315 | ?t (tramp-get-connection-property | 2323 | ?t (tramp-get-connection-property |
| 2316 | (tramp-get-connection-process v) "temp-file" "") | 2324 | (tramp-get-connection-process v) "temp-file" "") |