From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Jo Vermeulen Newsgroups: gmane.emacs.bugs Subject: bug#7289: Tramp changes ownership of remote file when saving Date: Wed, 27 Oct 2010 17:21:45 +0200 Message-ID: References: NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 X-Trace: dough.gmane.org 1288195408 7191 80.91.229.12 (27 Oct 2010 16:03:28 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Wed, 27 Oct 2010 16:03:28 +0000 (UTC) Cc: 7289@debbugs.gnu.org To: Stefan Monnier Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Wed Oct 27 18:03:26 2010 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1PB8TE-0005fN-LP for geb-bug-gnu-emacs@m.gmane.org; Wed, 27 Oct 2010 18:03:24 +0200 Original-Received: from localhost ([127.0.0.1]:41184 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PB8TD-0004Am-V3 for geb-bug-gnu-emacs@m.gmane.org; Wed, 27 Oct 2010 12:03:24 -0400 Original-Received: from [140.186.70.92] (port=36485 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PB8At-0001pc-BS for bug-gnu-emacs@gnu.org; Wed, 27 Oct 2010 11:44:51 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1PB89V-0001aW-TN for bug-gnu-emacs@gnu.org; Wed, 27 Oct 2010 11:44:23 -0400 Original-Received: from debbugs.gnu.org ([140.186.70.43]:42810) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1PB89V-0001aS-Qb for bug-gnu-emacs@gnu.org; Wed, 27 Oct 2010 11:43:01 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.69) (envelope-from ) id 1PB7lL-00062l-Bs; Wed, 27 Oct 2010 11:18:03 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Jo Vermeulen Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-To: owner@debbugs.gnu.org Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 27 Oct 2010 15:18:03 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 7289 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 7289-submit@debbugs.gnu.org id=B7289.128819268123225 (code B ref 7289); Wed, 27 Oct 2010 15:18:03 +0000 Original-Received: (at 7289) by debbugs.gnu.org; 27 Oct 2010 15:18:01 +0000 Original-Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1PB7lJ-00062Y-AI for submit@debbugs.gnu.org; Wed, 27 Oct 2010 11:18:01 -0400 Original-Received: from mail-qw0-f44.google.com ([209.85.216.44]) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1PB7lH-00062R-CC for 7289@debbugs.gnu.org; Wed, 27 Oct 2010 11:18:00 -0400 Original-Received: by qwb7 with SMTP id 7so798272qwb.3 for <7289@debbugs.gnu.org>; Wed, 27 Oct 2010 08:22:06 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:mime-version:received:in-reply-to :references:from:date:message-id:subject:to:cc:content-type; bh=udkyTdSC0lZZBn+2swnJx7ulHApp6H/IVN7GFTSXQVA=; b=j6+YfMSpptiLKa5V91GksjSgXZ/PrVxxch3a3MkXBefn0ofEK2iitw/2LemN3GpHv8 NbyFvaANa+gBWSkAjPjD9xcgkxN9kOEVmdbwdC1/xPH/wTooepQa3yYYKdrP6IICuuJF XGlLpv/tpfm4urAVbs99jWdcE8du35pWEeIGk= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc:content-type; b=Q5+P3kRPuMDVW/mFUuOK4X+hwIJo0HbYQ16Chq7DkH/iHozFiRcHfL6LKf6BWfyyDu BA5BRV7LK5aPu0og3cra72UrWWfR+nwuc7bAgdEp6BvYK0IKd8PRIFZNJY1pORiKJP1w Vrjk9m7PM2CHolCEy/a8aeCqxdKrd5llTMAYA= Original-Received: by 10.229.236.14 with SMTP id ki14mr6389576qcb.78.1288192925999; Wed, 27 Oct 2010 08:22:05 -0700 (PDT) Original-Received: by 10.229.127.99 with HTTP; Wed, 27 Oct 2010 08:21:45 -0700 (PDT) In-Reply-To: X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list Resent-Date: Wed, 27 Oct 2010 11:18:03 -0400 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3) X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:41168 Archived-At: On Wed, Oct 27, 2010 at 3:53 PM, Stefan Monnier wrote: >> When editing a remote file over SSH using tramp, emacs changes the ownership >> of the file. I was logged in as root, and the file had ownership svn:svn. >> After saving, however, emacs changed the ownership to root:root. The backup >> file (filename~) did have the user/group settings however. > > What are your settings for backup-by-copying and > backup-by-copying-when-mismatch? C-h-v backup-by-coping gives me: "backup-by-copying's value is nil" Which, I assume, means that Emacs might use renaming for backups. And C-h-v backup-by-coping-when-mismatch results in: "backup-by-copying-when-mismatch's value is nil" I guess if this value would be non-nil, my problem would be solved? Additionally, C-h-v backup-by-copying-when-privileged-mismatch gives me: "backup-by-copying-when-privileged-mismatch's value is 200" I just toggled backup-by-copying-when-mismatch and tried it again, and indeed, it does work now. I'm just wondering if this means that the default behavior is broken? It seems Emacs automatically sets backup-by-copying-when-mismatch to t when it is run by the superuser (root) to overcome this problem (source: http://www.delorie.com/gnu/docs/emacs/emacs_117.html). I don't think many people will run Emacs as root in this day and age. However, they might log in as root on a remote server, or edit a file as root (using sudo/su). Maybe Emacs or Tramp should also automatically set the backup-by-copying-when-mismatch variable to t in those cases? Thanks for your help! Cheers, -- Jo