emacs-devel
[Top][All Lists]
Advanced

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

Re: address@hidden: tramp sudo:: and version control on RCS root control


From: Andre Spiegel
Subject: Re: address@hidden: tramp sudo:: and version control on RCS root controlled files]
Date: Sun, 20 Nov 2005 18:46:50 +0100

On Sun, 2005-11-20 at 12:02 -0500, Stefan Monnier wrote:

> > The only solution I can think of would be to have a new
> > file-handler-sensitive operation (file-login-name FILE) which returns
> > the name of the user under which Emacs accesses the given FILE.  For
> > local files, that would be equivalent to user-login-name, for remote
> > files it would be the name of the remote user, or "root" if Tramp sudo::
> > is involved.
> 
> We could try and use (process-file "whoami") or (process-file "id").

Very good idea.  I would wrap it so that it calls the external program
only for Tramp files, and uses user-login-name for local files.

A related operation, also used in VC, is to find a user's login name,
given the uid of that user.  In the local case, Emacs does it via
(user-login-name UID), which is implemented as getpwuid().  How would
you do that for a remote file?  I'm currently baffled as to how I could
get that information at the shell level, sans grepping /etc/passwd of
course.






reply via email to

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