* Mode of auto-saved remote files
@ 2004-10-02 15:45 Michael Albinus
2004-10-02 15:54 ` Andreas Schwab
2004-10-03 14:34 ` Richard Stallman
0 siblings, 2 replies; 5+ messages in thread
From: Michael Albinus @ 2004-10-02 15:45 UTC (permalink / raw)
[-- Attachment #1: Type: text/plain, Size: 400 bytes --]
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.
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: Type: text/x-patch, Size: 473 bytes --]
*** 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;
[-- Attachment #3: Type: text/plain, Size: 142 bytes --]
_______________________________________________
Emacs-devel mailing list
Emacs-devel@gnu.org
http://lists.gnu.org/mailman/listinfo/emacs-devel
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: Mode of auto-saved remote files
2004-10-02 15:45 Mode of auto-saved remote files Michael Albinus
@ 2004-10-02 15:54 ` Andreas Schwab
2004-10-02 16:13 ` Michael Albinus
2004-10-03 14:34 ` Richard Stallman
1 sibling, 1 reply; 5+ messages in thread
From: Andreas Schwab @ 2004-10-02 15:54 UTC (permalink / raw)
Cc: emacs-devel
Michael Albinus <michael.albinus@gmx.de> writes:
> *** 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;
That lacks an XINT.
Andreas.
--
Andreas Schwab, SuSE Labs, schwab@suse.de
SuSE Linux AG, Maxfeldstraße 5, 90409 Nürnberg, Germany
Key fingerprint = 58CA 54C7 6D53 942B 1756 01D3 44D5 214B 8276 4ED5
"And now for something completely different."
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: Mode of auto-saved remote files
2004-10-02 15:54 ` Andreas Schwab
@ 2004-10-02 16:13 ` Michael Albinus
0 siblings, 0 replies; 5+ messages in thread
From: Michael Albinus @ 2004-10-02 16:13 UTC (permalink / raw)
Cc: emacs-devel
[-- Attachment #1: Type: text/plain, Size: 121 bytes --]
Andreas Schwab <schwab@suse.de> writes:
> That lacks an XINT.
>
> Andreas.
Indeed. Thanks, and best regards, Michael.
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: Type: text/x-patch, Size: 478 bytes --]
*** fileio.c 29 Sep 2004 23:41:54 -0000 1.515
--- fileio.c 2 Oct 2004 16:12:12 -0000
***************
*** 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 = XINT (Ffile_modes (current_buffer->filename)) | 0600;
else
auto_save_mode_bits = 0666;
[-- Attachment #3: Type: text/plain, Size: 142 bytes --]
_______________________________________________
Emacs-devel mailing list
Emacs-devel@gnu.org
http://lists.gnu.org/mailman/listinfo/emacs-devel
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: Mode of auto-saved remote files
2004-10-02 15:45 Mode of auto-saved remote files Michael Albinus
2004-10-02 15:54 ` Andreas Schwab
@ 2004-10-03 14:34 ` Richard Stallman
2004-10-03 17:41 ` Michael Albinus
1 sibling, 1 reply; 5+ messages in thread
From: Richard Stallman @ 2004-10-03 14:34 UTC (permalink / raw)
Cc: emacs-devel
Auto-saved copies of remote files are created with default permissions
(666 minus umask). By this, sensitive files can be read by other
users.
Please install the corrected version of the patch.
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2004-10-03 17:41 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-10-02 15:45 Mode of auto-saved remote files Michael Albinus
2004-10-02 15:54 ` Andreas Schwab
2004-10-02 16:13 ` Michael Albinus
2004-10-03 14:34 ` Richard Stallman
2004-10-03 17:41 ` Michael Albinus
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.