aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Albinus2008-01-27 16:20:57 +0000
committerMichael Albinus2008-01-27 16:20:57 +0000
commit2991e49f20dc4a7af55cc94802f3c69c47679c76 (patch)
tree1f466604c9cc042147b02bdc142129d9623f08af
parent4605b7cdc1418949633408e60907e2ef41b4da33 (diff)
downloademacs-2991e49f20dc4a7af55cc94802f3c69c47679c76.tar.gz
emacs-2991e49f20dc4a7af55cc94802f3c69c47679c76.zip
* net/tramp.el (tramp-compute-multi-hops): In case of su(do)?
methods, the host name must be a local host.
-rw-r--r--lisp/ChangeLog5
-rw-r--r--lisp/net/tramp.el21
2 files changed, 26 insertions, 0 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index 679784fbcd0..20478b7511c 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,3 +1,8 @@
12008-01-27 Michael Albinus <michael.albinus@gmx.de>
2
3 * net/tramp.el (tramp-compute-multi-hops): In case of su(do)?
4 methods, the host name must be a local host.
5
12008-01-27 Dan Nicolaescu <dann@ics.uci.edu> 62008-01-27 Dan Nicolaescu <dann@ics.uci.edu>
2 7
3 * server.el (server-process-filter): Check for non-nil before 8 * server.el (server-process-filter): Check for non-nil before
diff --git a/lisp/net/tramp.el b/lisp/net/tramp.el
index 9fba537f006..b9e6a279644 100644
--- a/lisp/net/tramp.el
+++ b/lisp/net/tramp.el
@@ -6052,6 +6052,27 @@ Gateway hops are already opened."
6052 "Method `%s' is not supported for multi-hops." 6052 "Method `%s' is not supported for multi-hops."
6053 (tramp-file-name-method item))))) 6053 (tramp-file-name-method item)))))
6054 6054
6055 ;; In case the host name is not used for the remote shell
6056 ;; command, the user could be misguided by applying a random
6057 ;; hostname.
6058 (let* ((v (car target-alist))
6059 (method (tramp-file-name-method v))
6060 (host (tramp-file-name-host v)))
6061 (unless
6062 (or
6063 ;; There are multi-hops.
6064 (cdr target-alist)
6065 ;; The host name is used for the remote shell command.
6066 (member
6067 '("%h") (tramp-get-method-parameter method 'tramp-login-args))
6068 ;; The host is local. We cannot use `tramp-local-host-p'
6069 ;; here, because it opens a connection as well.
6070 (string-match
6071 (concat "^" (regexp-opt (list "localhost" (system-name)) t) "$")
6072 host))
6073 (tramp-error
6074 v 'file-error "Wrong hostname `%s' for method `%s'" host method)))
6075
6055 ;; Result. 6076 ;; Result.
6056 target-alist)) 6077 target-alist))
6057 6078