+2008-01-27 Michael Albinus <michael.albinus@gmx.de>
+
+ * net/tramp.el (tramp-compute-multi-hops): In case of su(do)?
+ methods, the host name must be a local host.
+
2008-01-27 Dan Nicolaescu <dann@ics.uci.edu>
* server.el (server-process-filter): Check for non-nil before
"Method `%s' is not supported for multi-hops."
(tramp-file-name-method item)))))
+ ;; In case the host name is not used for the remote shell
+ ;; command, the user could be misguided by applying a random
+ ;; hostname.
+ (let* ((v (car target-alist))
+ (method (tramp-file-name-method v))
+ (host (tramp-file-name-host v)))
+ (unless
+ (or
+ ;; There are multi-hops.
+ (cdr target-alist)
+ ;; The host name is used for the remote shell command.
+ (member
+ '("%h") (tramp-get-method-parameter method 'tramp-login-args))
+ ;; The host is local. We cannot use `tramp-local-host-p'
+ ;; here, because it opens a connection as well.
+ (string-match
+ (concat "^" (regexp-opt (list "localhost" (system-name)) t) "$")
+ host))
+ (tramp-error
+ v 'file-error "Wrong hostname `%s' for method `%s'" host method)))
+
;; Result.
target-alist))