]> git.eshelyaron.com Git - emacs.git/commitdiff
Tweak Tramp method definition syntax to allow overriding check for localhost-only...
authorDaniel Colascione <dancol@dancol.org>
Tue, 29 Oct 2013 02:50:24 +0000 (19:50 -0700)
committerDaniel Colascione <dancol@dancol.org>
Tue, 29 Oct 2013 02:50:24 +0000 (19:50 -0700)
lisp/ChangeLog
lisp/net/tramp-sh.el
lisp/net/tramp.el

index 34ac8ffd5e5a0c54360e684cdcc7ab8cb443d49e..f2d0d598c383b8e281fb49c827398c83a9219318 100644 (file)
@@ -1,3 +1,10 @@
+2013-10-29  Daniel Colascione  <dancol@dancol.org>
+
+       * net/tramp.el (tramp-methods): Document new functionality.
+       * net/tramp-sh.el (tramp-compute-multi-hops): Punt to
+       tramp-hostname-checker if method provides one instead of scanning
+       argument list for "%h" to decide hostname acceptability.
+
 2013-10-28  Michael Albinus  <michael.albinus@gmx.de>
 
        * net/tramp-sh.el (tramp-sh-handle-copy-directory):
index f69859ddb1019f8583a217ce9c9ae0de5f376515..3ed2cd324e8d3937972cbb6011cd941f4ad73bce 100644 (file)
@@ -4285,6 +4285,10 @@ Gateway hops are already opened."
          (or
           ;; There are multi-hops.
           (cdr target-alist)
+           ;; This method explicitly has an explicit allowability check.
+           (let ((checker (tramp-get-method-parameter
+                           method 'tramp-hostname-checker)))
+             (when checker (funcall checker v host method) t))
           ;; The host name is used for the remote shell command.
           (member
            '("%h") (tramp-get-method-parameter method 'tramp-login-args))
index 2cbaf4a1636228c2f52ecfdebf635dd50b7b1ce1..f076f043c5f651f08b662e6fc51927170767efd2 100644 (file)
@@ -265,6 +265,15 @@ pair of the form (KEY VALUE).  The following KEYs are defined:
     In general, the global default value shall be used, but for
     some methods, like \"su\" or \"sudo\", a shorter timeout
     might be desirable.
+  * `tramp-hostname-checker'
+    This is a function that tramp calls while setting
+    up a connection.  It is called with three arguments:
+    the target, the host, and the method description.  If
+    the hostname is unacceptable, this function should signal
+    using `tramp-error'.  If a method does not provide
+    a value here, then Tramp looks at whether the method's
+    login program uses a \"%h\" parameter.  If not, then Tramp
+    requires that the given hostname match `tramp-local-host-regexp'. 
 
 What does all this mean?  Well, you should specify `tramp-login-program'
 for all methods; this program is used to log in to the remote site.  Then,