From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Teemu Likonen Newsgroups: gmane.emacs.bugs Subject: bug#3712: 23.1.50; SECURITY: Tramp creates -rwxrwxrwx permission files with /su and /sudo method Date: Tue, 30 Jun 2009 16:57:26 +0300 Message-ID: <871vp1bz95.fsf@iki.fi> References: <87ljnbax4h.fsf@iki.fi> <8763eevosc.fsf@iki.fi> <87ws6uzqqg.fsf@gmx.de> <878wjau0x5.fsf@iki.fi> Reply-To: Teemu Likonen , 3712@emacsbugs.donarmstrong.com NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: ger.gmane.org 1246372651 25816 80.91.229.12 (30 Jun 2009 14:37:31 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Tue, 30 Jun 2009 14:37:31 +0000 (UTC) Cc: 3712@emacsbugs.donarmstrong.com To: Michael Albinus Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Tue Jun 30 16:37:19 2009 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from mail-forward1.uio.no ([129.240.10.70]) by lo.gmane.org with esmtp (Exim 4.50) id 1MLeSK-00021i-Ff for geb-bug-gnu-emacs@m.gmane.org; Tue, 30 Jun 2009 16:37:08 +0200 Original-Received: from exim by mail-out1.uio.no with local-bsmtp (Exim 4.69) (envelope-from ) id 1MLeKA-0003x2-12 for geb-bug-gnu-emacs@m.gmane.org; Tue, 30 Jun 2009 16:28:42 +0200 Original-Received: from mail-mx5.uio.no ([129.240.10.46]) by mail-out1.uio.no with esmtp (Exim 4.69) (envelope-from ) id 1MLeK9-0003wz-WA for geb-bug-gnu-emacs@m.gmane.org; Tue, 30 Jun 2009 16:28:41 +0200 Original-Received: from lists.gnu.org ([199.232.76.165]) by mail-mx5.uio.no with esmtps (TLSv1:AES256-SHA:256) (Exim 4.69) (envelope-from ) id 1MLeK9-0000hX-3c for geb-bug-gnu-emacs@m.gmane.org; Tue, 30 Jun 2009 16:28:41 +0200 Original-Received: from localhost ([127.0.0.1]:60586 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MLeK7-0005Xp-JH for geb-bug-gnu-emacs@m.gmane.org; Tue, 30 Jun 2009 10:28:39 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1MLe9N-0008DF-DW for bug-gnu-emacs@gnu.org; Tue, 30 Jun 2009 10:17:33 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1MLe9I-00088T-Gt for bug-gnu-emacs@gnu.org; Tue, 30 Jun 2009 10:17:32 -0400 Original-Received: from [199.232.76.173] (port=43430 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MLe9I-00088J-BJ for bug-gnu-emacs@gnu.org; Tue, 30 Jun 2009 10:17:28 -0400 Original-Received: from rzlab.ucr.edu ([138.23.92.77]:47893) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1MLe9H-0007Tb-1T for bug-gnu-emacs@gnu.org; Tue, 30 Jun 2009 10:17:27 -0400 Original-Received: from rzlab.ucr.edu (rzlab.ucr.edu [127.0.0.1]) by rzlab.ucr.edu (8.14.3/8.14.3/Debian-5) with ESMTP id n5UEHODD021197; Tue, 30 Jun 2009 07:17:25 -0700 Original-Received: (from debbugs@localhost) by rzlab.ucr.edu (8.14.3/8.14.3/Submit) id n5UE54kI018394; Tue, 30 Jun 2009 07:05:04 -0700 X-Loop: owner@emacsbugs.donarmstrong.com Resent-From: Teemu Likonen Resent-To: bug-submit-list@donarmstrong.com Resent-CC: Emacs Bugs Resent-Date: Tue, 30 Jun 2009 14:05:04 +0000 Resent-Message-ID: Resent-Sender: owner@emacsbugs.donarmstrong.com X-Emacs-PR-Message: followup 3712 X-Emacs-PR-Package: emacs X-Emacs-PR-Keywords: Original-Received: via spool by 3712-submit@emacsbugs.donarmstrong.com id=B3712.124637025617236 (code B ref 3712); Tue, 30 Jun 2009 14:05:04 +0000 Original-Received: (at 3712) by emacsbugs.donarmstrong.com; 30 Jun 2009 13:57:36 +0000 X-Spam-Bayes: score:0.5 Bayes not run. spammytokens:Tokens not available. hammytokens:Tokens not available. Original-Received: from jenni1.inet.fi (mta-out.inet.fi [195.156.147.13]) by rzlab.ucr.edu (8.14.3/8.14.3/Debian-5) with ESMTP id n5UDvVqo017212 for <3712@emacsbugs.donarmstrong.com>; Tue, 30 Jun 2009 06:57:32 -0700 Original-Received: from mithlond.arda.local (80.220.180.181) by jenni1.inet.fi (8.5.014) id 49F59766024F1E48; Tue, 30 Jun 2009 16:57:27 +0300 Original-Received: from dtw by mithlond.arda.local with local (Exim 4.69) (envelope-from ) id 1MLdpu-0004Vi-R3; Tue, 30 Jun 2009 16:57:26 +0300 In-Reply-To: (Michael Albinus's message of "Tue, 30 Jun 2009 14:21:53 +0200") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.1.50 (gnu/linux) X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6 (newer, 2) Resent-Date: Tue, 30 Jun 2009 10:17:32 -0400 X-BeenThere: bug-gnu-emacs@gnu.org X-Mailman-Version: 2.1.5 Precedence: list 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 X-UiO-Spam-info: not spam, SpamAssassin (score=-4.0, required=5.0, autolearn=disabled, RCVD_IN_DNSWL_MED=-4, uiobl=NO, uiouri=_URIID_) X-UiO-Scanned: 639B799A9837C6207153DED4BB780336A7BDCB99 X-UiO-SPAM-Test: remote_host: 199.232.76.165 spam_score: -39 maxlevel 80 minaction 2 bait 0 mail/h: 19 total 102071 max/h 424 blacklist 0 greylist 0 ratelimit 0 Xref: news.gmane.org gmane.emacs.bugs:29106 Archived-At: On 2009-06-30 14:21 (+0200), Michael Albinus wrote: > When creating a new file, Tramp uses Emacs' default file modes. You > can check them with "M-: (default-file-modes)". > > If you want to change them, you could apply for example "M-: > (set-default-file-modes #o0400)". The value is used then for all newly > created files, also for local ones. Hmm, I didn't know about those functions, thanks. And I compiled my Emacs with your recent changes too. I still don't like the default difference between creating a file as a normal user or through /su: or /sudo:. Here's again an example starting from command umask 0022; emacs -Q When I create a file without Tramp (C-x C-f ~/test.txt RET) to my home directory it gets bits 0644. When I create a file through Tramp to /sudo::/root/test.txt it gets bits 0755 (i.e. with executable bits). In both cases Emacs's default-file-modes is the same, the untouched default which is #o755. In fact, all the settings are the same. I'm not sure where this difference should be fixed but from user's point of view the Tramp part brings the unexpected end result. It's unexpected because no other programs create new executable files by default, even when umask doesn't mask executable bits. I appreciate your hint about set-default-file-modes, and I'll use it if necessary, but in my opinion user shouldn't need to run (set-default-file-modes #o0644) in her ~/.emacs just because she wants Tramp to behave similarly to her umask=0022 settings. Instead, the similar behavior should be the default. >> And when editing existing files it should obviously respect the bits >> that the file already has. Currently -- even with this fix -- tramp >> is adding "x" bits at some point because "backup by rename" moves old >> version out of the way and new is created with -rwxr-xr-x bits. > > As I said already, I cannot reproduce it. However, there seems to be a > small annoyance in special cases. I've fixed this. Could you, please, > check, whether it is OK now for you? I could reproduce it before but it seems that not anymore with your newest changes. If you want clear steps how to reproduce it I can inspect the issue more closely. Anyway, thanks for your work on Tramp and Emacs! :-)