unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Andre Spiegel <spiegel@gnu.org>
Cc: Kai Gro?johann <kai@emptydomain.de>, emacs-devel@gnu.org
Subject: Re: Tramp and VC integration: "calling user"
Date: Thu, 31 Mar 2005 18:54:34 +0200	[thread overview]
Message-ID: <1112288074.17621.23.camel@localhost> (raw)
In-Reply-To: <87mzskym6e.fsf-monnier+emacs@gnu.org>

On Thu, 2005-03-31 at 08:34 -0500, Stefan Monnier wrote:

> Could you remind me why file-writable-p can't be used?

The conditions "file is writable by the calling user" and "file is
locked by the calling user" are not equivalent.  They can differ if
somebody modifies file permissions deliberately (I've seen this happen
at most sites where RCS is used).  They also differ if RCS is used with
non-strict locking.

VC has lots of code to detect mismatches between the two conditions,
because they do occur all the time in real world situations.  There is
also a special user option, vc-mistrust-permissions, which does
precisely what the name suggests.

So, in short, it is not possible to use file-writable-p.  There needs to
be a way, as Kai described, to compare the name of the calling user and
the name of the locking user as per the RCS master file.

I think the suggestion no. 2, file-calling-user, is best.  Conceptually,
it is something like "user-login-name relative to a given file".  For
files on the local machine, it is the name of the user running Emacs.
For files on a remote machine, it is the name of the user under which
the files are accessed (the login account at the remote machine).
Perhaps it would be worthwhile to add an optional FILE argument to
user-login-name, but it already has an optional argument, UID, so
perhaps a new function, file-calling-user, as Kai suggests, is best.

  parent reply	other threads:[~2005-03-31 16:54 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-03-31 13:07 Tramp and VC integration: "calling user" Kai Großjohann
2005-03-31 13:34 ` Stefan Monnier
2005-03-31 14:40   ` Kai Großjohann
2005-03-31 15:50     ` Stefan Monnier
2005-03-31 17:13       ` Kai Großjohann
2005-03-31 16:54   ` Andre Spiegel [this message]
2005-04-01  4:10 ` Richard Stallman
2005-04-01 17:43   ` Andre Spiegel
2005-04-01 19:14     ` Stefan Monnier
2005-04-02 20:52       ` Andre Spiegel
2005-04-03 17:19         ` Michael Albinus
2005-04-03  5:19     ` Richard Stallman
2005-04-03 10:15 ` Kai Großjohann

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

  List information: https://www.gnu.org/software/emacs/

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

  git send-email \
    --in-reply-to=1112288074.17621.23.camel@localhost \
    --to=spiegel@gnu.org \
    --cc=emacs-devel@gnu.org \
    --cc=kai@emptydomain.de \
    /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 public inbox

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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).