tramp-devel
[Top][All Lists]
Advanced

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

Re: /sudo:<user>@172.0.0.1:/<file> works, /sudo:<user>@localhost:/<file>


From: Michael Albinus
Subject: Re: /sudo:<user>@172.0.0.1:/<file> works, /sudo:<user>@localhost:/<file> doesn't
Date: Wed, 23 Jan 2008 09:46:14 +0100
User-agent: Gnus/5.1008 (Gnus v5.10.8) Emacs/21.3 (hpux)

Gilles Pion <address@hidden> writes:

>> (defalias 'tramp-local-host-p 'ignore)
>
> fixed, thanks

OK, here is a real fix: could you, please, test?

(defun tramp-local-host-p (vec)
  "Return t if this points to the local host, nil otherwise."
  ;; We cannot use `tramp-file-name-real-host'.  A port is an
  ;; indication for an ssh tunnel or alike.
  (let ((host (tramp-file-name-host vec)))
    (and
     (stringp host)
     (string-match
      (concat "^" (regexp-opt (list "localhost" (system-name)) t) "$") host)
     ;; The local temp directory must be writable for the other user.
     (file-writable-p
      (tramp-make-tramp-file-name
       (tramp-file-name-method vec)
       (tramp-file-name-user vec)
       host
       (tramp-compat-temporary-file-directory))))))

> Gilles

Best regards, Michael.





reply via email to

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