From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Stefan Monnier Newsgroups: gmane.emacs.devel Subject: Re: Tramp and VC integration: "calling user" Date: Fri, 01 Apr 2005 14:14:19 -0500 Message-ID: References: <87is386k0h.fsf@emptydomain.de> <1112377387.17621.111.camel@localhost> NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: sea.gmane.org 1112383048 6306 80.91.229.2 (1 Apr 2005 19:17:28 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Fri, 1 Apr 2005 19:17:28 +0000 (UTC) Cc: =?iso-8859-1?q?Kai_Gro=DFjohann?= , rms@gnu.org, emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Fri Apr 01 21:17:26 2005 Return-path: Original-Received: from lists.gnu.org ([199.232.76.165]) by ciao.gmane.org with esmtp (Exim 4.43) id 1DHRde-0003yr-4b for ged-emacs-devel@m.gmane.org; Fri, 01 Apr 2005 21:17:02 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1DHRub-0002pb-55 for ged-emacs-devel@m.gmane.org; Fri, 01 Apr 2005 14:34:33 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1DHRuD-0002mB-Pv for emacs-devel@gnu.org; Fri, 01 Apr 2005 14:34:10 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1DHRuB-0002lL-M9 for emacs-devel@gnu.org; Fri, 01 Apr 2005 14:34:07 -0500 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1DHRuB-0002lI-Jc for emacs-devel@gnu.org; Fri, 01 Apr 2005 14:34:07 -0500 Original-Received: from [132.204.24.67] (helo=mercure.iro.umontreal.ca) by monty-python.gnu.org with esmtp (Exim 4.34) id 1DHRb8-0005d8-DC; Fri, 01 Apr 2005 14:14:26 -0500 Original-Received: from hidalgo.iro.umontreal.ca (hidalgo.iro.umontreal.ca [132.204.27.50]) by mercure.iro.umontreal.ca (Postfix) with ESMTP id 823DA34004C; Fri, 1 Apr 2005 14:14:25 -0500 (EST) Original-Received: from asado.iro.umontreal.ca (asado.iro.umontreal.ca [132.204.24.84]) by hidalgo.iro.umontreal.ca (Postfix) with ESMTP id ED94E4AC260; Fri, 1 Apr 2005 14:14:19 -0500 (EST) Original-Received: by asado.iro.umontreal.ca (Postfix, from userid 20848) id D90E3F69C4; Fri, 1 Apr 2005 14:14:19 -0500 (EST) Original-To: Andre Spiegel In-Reply-To: <1112377387.17621.111.camel@localhost> (Andre Spiegel's message of "Fri, 01 Apr 2005 19:43:07 +0200") User-Agent: Gnus/5.11 (Gnus v5.11) Emacs/22.0.50 (gnu/linux) X-DIRO-MailScanner-Information: Please contact the ISP for more information X-DIRO-MailScanner: Found to be clean X-DIRO-MailScanner-SpamCheck: n'est pas un polluriel, SpamAssassin (score=-4.828, requis 5, autolearn=not spam, AWL 0.07, BAYES_00 -4.90) X-MailScanner-From: monnier@iro.umontreal.ca X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:35485 X-Report-Spam: http://spam.gmane.org/gmane.emacs.devel:35485 >> (1) New file operation file-mine-p, returns true if the file is owned >> by the "calling user". For non-special files, the calling user is >> the user who invoked Emacs. For Tramp files, the calling user is >> the user logged into the remote host. >> >> (2) New file operation file-calling-user, returns the calling user, as >> defined in (1). >> >> (3) Augment the return value of file-remote-p to indicate the calling >> user. The return value could be augmented to also indicate the >> remote host, if the file is remote. >> >> #3 seems kludgy, so it shouldn't be that. I prefer #1. > But #1 is in fact wrong. It is irrelevant who the owner of the file is > (the same argument as I made concerning file-writable-p). What must be > tested is whether the name of the locking user, as recorded in the RCS > master file, is that of the calling user. I still think #2 is the best > way to achieve this. Am I right in believing that this is a problem specific to vc-rcs.el? Couldn't vc-rcs.el use RCS directly instead of reproducing RCS's behavior? I.e. just try a dry-run of `co', and see if it fails? Or otherwise run (shell-command "id") since shell-command is a fileop that can be caught by file-name-handlers and run on the remote host. I just feel that adding a global command is difficult to justify just for the odd case where all the following conditions are met: - you're using vc-rcs.el. - you're using it over Tramp. - you've played with the permissions such that they don't give us directly the proper information about whether a file is locked. Stefan