From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Stefan Monnier Newsgroups: gmane.emacs.bugs Subject: bug#7289: Tramp changes ownership of remote file when saving Date: Sun, 31 Oct 2010 15:15:08 -0400 Message-ID: References: <874oc6ze69.fsf@gmx.de> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: dough.gmane.org 1288554216 14893 80.91.229.12 (31 Oct 2010 19:43:36 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Sun, 31 Oct 2010 19:43:36 +0000 (UTC) Cc: 7289@debbugs.gnu.org, Jo Vermeulen To: Michael Albinus Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Sun Oct 31 20:43:30 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 1PCdoQ-0000RI-Il for geb-bug-gnu-emacs@m.gmane.org; Sun, 31 Oct 2010 20:43:30 +0100 Original-Received: from localhost ([127.0.0.1]:37061 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PCdoP-0005aJ-UW for geb-bug-gnu-emacs@m.gmane.org; Sun, 31 Oct 2010 15:43:30 -0400 Original-Received: from [140.186.70.92] (port=39295 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PCdoH-0005ZS-GY for bug-gnu-emacs@gnu.org; Sun, 31 Oct 2010 15:43:26 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1PCdoC-0005hQ-CW for bug-gnu-emacs@gnu.org; Sun, 31 Oct 2010 15:43:21 -0400 Original-Received: from debbugs.gnu.org ([140.186.70.43]:60585) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1PCdoC-0005hA-7p for bug-gnu-emacs@gnu.org; Sun, 31 Oct 2010 15:43:16 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.69) (envelope-from ) id 1PCdIz-0003JD-KG; Sun, 31 Oct 2010 15:11:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Stefan Monnier Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-To: owner@debbugs.gnu.org Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 31 Oct 2010 19:11:01 +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.128855225312713 (code B ref 7289); Sun, 31 Oct 2010 19:11:01 +0000 Original-Received: (at 7289) by debbugs.gnu.org; 31 Oct 2010 19:10:53 +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 1PCdIq-0003J0-Td for submit@debbugs.gnu.org; Sun, 31 Oct 2010 15:10:53 -0400 Original-Received: from ironport2-out.teksavvy.com ([206.248.154.183] helo=ironport2-out.pppoe.ca) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1PCdIp-0003Iv-J1 for 7289@debbugs.gnu.org; Sun, 31 Oct 2010 15:10:51 -0400 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AskIAJtczUxFpYZA/2dsb2JhbACgSX5yuVaFRASSKw X-IronPort-AV: E=Sophos;i="4.58,268,1286164800"; d="scan'208";a="81202626" Original-Received: from 69-165-134-64.dsl.teksavvy.com (HELO pastel.home) ([69.165.134.64]) by ironport2-out.pppoe.ca with ESMTP/TLS/ADH-AES256-SHA; 31 Oct 2010 15:15:09 -0400 Original-Received: by pastel.home (Postfix, from userid 20848) id CE2EBA8621; Sun, 31 Oct 2010 15:15:08 -0400 (EDT) In-Reply-To: <874oc6ze69.fsf@gmx.de> (Michael Albinus's message of "Thu, 28 Oct 2010 14:37:18 +0200") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.0.50 (gnu/linux) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list Resent-Date: Sun, 31 Oct 2010 15:11:01 -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:41312 Archived-At: > ! ;; For root, preserve owner and group when editing files. > ! (when (string-equal (file-remote-p filename 'user) "root") > ! (set (make-local-variable 'backup-by-copying-when-mismatch) t) > ! (put 'backup-by-copying-when-mismatch 'permanent-local t))) 2 problems with this patch: - (put 'permanent-local t) should *never* be in such a function. It's a top-level operation that has global effects and belongs right next to the var's defvar. - This makes it impossible to choose backup-by-copying-when-mismatch=nil when accessing such remote files, whereas for local files accessed by root a (setq backup-by-copying-when-mismatch nil) in the .emacs will do the trick. A simpler solution would be to change the default value of backup-by-copying-when-mismatch to t for everyone rather than just for root. I don't know what would the objections to this. Stefan