summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Albinus <michael.albinus@gmx.de>2006-12-19 06:56:27 +0000
committerMichael Albinus <michael.albinus@gmx.de>2006-12-19 06:56:27 +0000
commit572b79d819f74af6619a7094b295cc7c8420d047 (patch)
tree8db36b8bd2859badc73d8221ee9611e19d8f8ddd
parent8eeae1c95749fc1453994b9fbf6aa9e329b172c5 (diff)
downloademacs-572b79d819f74af6619a7094b295cc7c8420d047.tar.gz
* net/tramp.el (tramp-methods): Introduce new method `scpc'.
Remove "ControlMaster" option from the other `scp*' methods. (tramp-default-method): Check for ssh-agent before setting to `scp'.
-rw-r--r--lisp/ChangeLog7
-rw-r--r--lisp/net/tramp.el81
2 files changed, 47 insertions, 41 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index 58bbab45b05..d0edd5da954 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,3 +1,10 @@
+2006-12-19 Michael Albinus <michael.albinus@gmx.de>
+
+ * net/tramp.el (tramp-methods): Introduce new method `scpc'.
+ Remove "ControlMaster" option from the other `scp*' methods.
+ (tramp-default-method): Check for ssh-agent before setting to
+ `scp'.
+
2006-12-18 Carsten Dominik <dominik@science.uva.nl>
* textmodes/org.el (org-mode): Show context after isearch.
diff --git a/lisp/net/tramp.el b/lisp/net/tramp.el
index b2e4ec814fd..fa4dcfbf63c 100644
--- a/lisp/net/tramp.el
+++ b/lisp/net/tramp.el
@@ -326,35 +326,24 @@ This variable defaults to the value of `tramp-encoding-shell'."
(tramp-login-program "ssh")
(tramp-copy-program "scp")
(tramp-remote-sh "/bin/sh")
- (tramp-login-args ("-o" "ControlPath=%t.%%r@%%h:%%p"
- "-o" "ControlMaster=yes"
- "-e" "none"))
- (tramp-copy-args ("-o" "ControlPath=%t.%%r@%%h:%%p"
- "-o" "ControlMaster=auto"))
+ (tramp-login-args ("-e" "none"))
+ (tramp-copy-args nil)
(tramp-copy-keep-date-arg "-p")
(tramp-password-end-of-line nil))
("scp1" (tramp-connection-function tramp-open-connection-rsh)
(tramp-login-program "ssh")
(tramp-copy-program "scp")
(tramp-remote-sh "/bin/sh")
- (tramp-login-args ("-o" "ControlPath=%t.%%r@%%h:%%p"
- "-o" "ControlMaster=yes"
- "-1" "-e" "none"))
- (tramp-copy-args ("-o" "ControlPath=%t.%%r@%%h:%%p"
- "-o" "ControlMaster=auto"
- "-1"))
+ (tramp-login-args ("-1" "-e" "none"))
+ (tramp-copy-args ("-1"))
(tramp-copy-keep-date-arg "-p")
(tramp-password-end-of-line nil))
("scp2" (tramp-connection-function tramp-open-connection-rsh)
(tramp-login-program "ssh")
(tramp-copy-program "scp")
(tramp-remote-sh "/bin/sh")
- (tramp-login-args ("-o" "ControlPath=%t.%%r@%%h:%%p"
- "-o" "ControlMaster=yes"
- "-2" "-e" "none"))
- (tramp-copy-args ("-o" "ControlPath=%t.%%r@%%h:%%p"
- "-o" "ControlMaster=auto"
- "-2"))
+ (tramp-login-args ("-2" "-e" "none"))
+ (tramp-copy-args ("-2"))
(tramp-copy-keep-date-arg "-p")
(tramp-password-end-of-line nil))
("scp1_old"
@@ -483,6 +472,17 @@ This variable defaults to the value of `tramp-encoding-shell'."
(tramp-copy-args nil)
(tramp-copy-keep-date-arg nil)
(tramp-password-end-of-line nil))
+ ("scpc" (tramp-connection-function tramp-open-connection-rsh)
+ (tramp-login-program "ssh")
+ (tramp-copy-program "scp")
+ (tramp-remote-sh "/bin/sh")
+ (tramp-login-args ("-o" "ControlPath=%t.%%r@%%h:%%p"
+ "-o" "ControlMaster=yes"
+ "-e" "none"))
+ (tramp-copy-args ("-o" "ControlPath=%t.%%r@%%h:%%p"
+ "-o" "ControlMaster=auto"))
+ (tramp-copy-keep-date-arg "-p")
+ (tramp-password-end-of-line nil))
("scpx" (tramp-connection-function tramp-open-connection-rsh)
(tramp-login-program "ssh")
(tramp-copy-program "scp")
@@ -684,33 +684,32 @@ various functions for details."
:type '(repeat (list string function string)))
(defcustom tramp-default-method
- (or
+ (cond
;; An external copy method seems to be preferred, because it is
;; much more performant for large files, and it hasn't too serious
;; delays for small files. But it must be ensured that there
- ;; aren't permanent password queries. Either the copy method shall
- ;; reuse other channels (ControlMaster of OpenSSH does it), a
- ;; password agent like "ssh-agent" or "Pageant" shall run, or the
- ;; optional password.el package shall be active for password caching.
- (and (fboundp 'executable-find)
- ;; Check whether PuTTY is installed.
- (executable-find "pscp")
- (if (or
- ;; password.el is loaded.
- (fboundp 'password-read)
- ;; Pageant is running.
- (and (fboundp 'w32-window-exists-p)
- (funcall (symbol-function 'w32-window-exists-p)
- "Pageant" "Pageant")))
- ;; We know that the password will not be retrieved again.
- "pscp"
- ;; When "pscp" exists, there is also "plink".
- "plink"))
- ;; Under UNIX, ControlMaster is activated. This does not work
- ;; under Cygwin, but ssh-agent must be enabled then anyway due to
- ;; the pseudo-tty problem of Cygwin's OpenSSH implementation. So
- ;; it doesn't hurt to use "scp".
- "scp")
+ ;; aren't permanent password queries. Either a password agent like
+ ;; "ssh-agent" or "Pageant" shall run, or the optional password.el
+ ;; package shall be active for password caching.
+ ((executable-find "pscp")
+ ;; PuTTY is installed.
+ (if (or (fboundp 'password-read)
+ ;; Pageant is running.
+ (and (fboundp 'w32-window-exists-p)
+ (funcall (symbol-function 'w32-window-exists-p)
+ "Pageant" "Pageant")))
+ "pscp"
+ "plink"))
+ ;; There is an ssh installation.
+ ((executable-find "scp")
+ (if (or (fboundp 'password-read)
+ ;; ssh-agent is running.
+ (getenv "SSH_AUTH_SOCK")
+ (getnev "SSH_AGENT_PID"))
+ "scp"
+ "ssh"))
+ ;; Fallback.
+ (t "ftp"))
"*Default method to use for transferring files.
See `tramp-methods' for possibilities.
Also see `tramp-default-method-alist'."