emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] Changes to emacs/lisp/net/tramp.el,v


From: Michael Albinus
Subject: [Emacs-diffs] Changes to emacs/lisp/net/tramp.el,v
Date: Sun, 27 Jan 2008 16:20:06 +0000

CVSROOT:        /sources/emacs
Module name:    emacs
Changes by:     Michael Albinus <albinus>       08/01/27 16:20:06

Index: tramp.el
===================================================================
RCS file: /sources/emacs/emacs/lisp/net/tramp.el,v
retrieving revision 1.171
retrieving revision 1.172
diff -u -b -r1.171 -r1.172
--- tramp.el    26 Jan 2008 14:54:55 -0000      1.171
+++ tramp.el    27 Jan 2008 16:20:05 -0000      1.172
@@ -6052,6 +6052,27 @@
           "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))
 




reply via email to

[Prev in Thread] Current Thread [Next in Thread]