all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Andre Spiegel <spiegel@gnu.org>
Cc: rms@gnu.org, emacs-devel@gnu.org
Subject: Re: [Ronan.Keryell@enstb.org: tramp sudo:: and version control on RCS root controlled files]
Date: Sun, 20 Nov 2005 18:46:50 +0100	[thread overview]
Message-ID: <1132508810.3050.102.camel@localhost> (raw)
In-Reply-To: <87psov6yo6.fsf-monnier+emacs@gnu.org>

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	other threads:[~2005-11-20 17:46 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <E1EYXgy-0001gS-J5@fencepost.gnu.org>
2005-11-19 11:17 ` [Ronan.Keryell@enstb.org: tramp sudo:: and version control on RCS root controlled files] Andre Spiegel
2005-11-20 17:02   ` Stefan Monnier
2005-11-20 17:46     ` Andre Spiegel [this message]
2005-11-20 19:03       ` Andreas Schwab
2005-11-20 22:49       ` Stefan Monnier
2005-11-21 10:11         ` Andre Spiegel
2005-11-21  9:53       ` Michael Albinus
2005-11-20 19:28     ` Eli Zaretskii
2005-11-20 22:50       ` Stefan Monnier
2005-11-20 23:23   ` Richard M. Stallman

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1132508810.3050.102.camel@localhost \
    --to=spiegel@gnu.org \
    --cc=emacs-devel@gnu.org \
    --cc=rms@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.