all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* 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

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.