On Tue, Sep 23, 2014 at 10:57 PM, Yuji Yamano <[email protected]> wrote:
> The code is taken from emacs 24.3. I guess getting the function from
> lisp/net/tramp-cmds.el in 24.2 and replacing "id" with "gid" work.
>
Thanks. I eventually got the 24.2 emacs-el package loaded on my box and
modified tramp-get-remote-id like so:
(defun tramp-get-remote-id (vec)
(with-connection-property vec "id"
(tramp-message vec 5 "Finding POSIX `id' command")
(or
(catch 'id-found
(let (dl name names result)
(setq names '("id" "gid"))
(while names
(setq name (car names))
(setq dl (tramp-get-remote-path vec))
(while (and dl
(setq result (tramp-find-executable vec name dl t t)))
;; Check POSIX parameter.
(when (tramp-send-command-and-check vec (format "%s -u" result))
(throw 'id-found result))
(setq dl (cdr dl)))
(setq names (cdr names)))))
(tramp-error vec 'file-error "Couldn't find a POSIX `id' command"))))
I'm not sure it's worthy of a modification to tramp, though I will note
that many people install the GNU version of various commands with a "g"
prefix, so maybe with a small amount of refactoring all the other
tramp-get-remote-* functions could be modified to call a helper function
which tries g-NAME after NAME.
(Apologies for the HTML mail. It's impossible to read code in Gmail without
making the code text fixed width.)
Skip
_______________________________________________
Tramp-devel mailing list
[email protected]
https://lists.gnu.org/mailman/listinfo/tramp-devel