From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: Michael Albinus Newsgroups: gmane.emacs.devel Subject: Mode of auto-saved remote files Date: Sat, 02 Oct 2004 17:45:58 +0200 Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Message-ID: <877jq99l8p.fsf@gmx.de> NNTP-Posting-Host: deer.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Trace: sea.gmane.org 1096731988 13701 80.91.229.6 (2 Oct 2004 15:46:28 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Sat, 2 Oct 2004 15:46:28 +0000 (UTC) Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sat Oct 02 17:46:19 2004 Return-path: Original-Received: from lists.gnu.org ([199.232.76.165]) by deer.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 1CDm5S-0001m7-00 for ; Sat, 02 Oct 2004 17:46:19 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.33) id 1CDmBx-0001FS-NS for ged-emacs-devel@m.gmane.org; Sat, 02 Oct 2004 11:53:01 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.33) id 1CDmBq-0001FG-9d for emacs-devel@gnu.org; Sat, 02 Oct 2004 11:52:54 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.33) id 1CDmBp-0001Ed-Fl for emacs-devel@gnu.org; Sat, 02 Oct 2004 11:52:53 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.33) id 1CDmBp-0001EX-DH for emacs-devel@gnu.org; Sat, 02 Oct 2004 11:52:53 -0400 Original-Received: from [213.165.64.20] (helo=mail.gmx.net) by monty-python.gnu.org with smtp (Exim 4.34) id 1CDm5A-000342-VP for emacs-devel@gnu.org; Sat, 02 Oct 2004 11:46:01 -0400 Original-Received: (qmail 12525 invoked by uid 65534); 2 Oct 2004 15:45:51 -0000 Original-Received: from pD9E715D7.dip0.t-ipconnect.de (EHLO magdalene.local) (217.231.21.215) by mail.gmx.net (mp023) with SMTP; 02 Oct 2004 17:45:51 +0200 X-Authenticated: #3708877 Original-To: emacs-devel@gnu.org User-Agent: Gnus/5.110003 (No Gnus v0.3) Emacs/21.3.50 (gnu/linux) 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: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: main.gmane.org gmane.emacs.devel:27797 X-Report-Spam: http://spam.gmane.org/gmane.emacs.devel:27797 --=-=-= Hello, Auto-saved copies of remote files are created with default permissions (666 minus umask). By this, sensitive files can be read by other users. It comes from the function `auto_save_1' of fileio.c, where the permissions of the original files are retrieved via `stat', which isn't possible for remote files. The following patch avoids this. Are there any objections? Best regards, Michael. --=-=-= Content-Type: text/x-patch Content-Disposition: attachment *** fileio.c 02 Oct 2004 16:14:24 +0200 1.515 --- fileio.c 02 Oct 2004 17:01:48 +0200 *************** *** 5718,5723 **** --- 5718,5725 ---- && stat (SDATA (current_buffer->filename), &st) >= 0) /* But make sure we can overwrite it later! */ auto_save_mode_bits = st.st_mode | 0600; + else if (! NILP (current_buffer->filename)) + auto_save_mode_bits = Ffile_modes (current_buffer->filename) | 0600; else auto_save_mode_bits = 0666; --=-=-= Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ Emacs-devel mailing list Emacs-devel@gnu.org http://lists.gnu.org/mailman/listinfo/emacs-devel --=-=-=--