Gnus development mailing list
 help / color / mirror / Atom feed
* permissions of dribble file
@ 1997-03-13 17:10 John Palmieri
  1997-03-13 17:35 ` Permissions of auto-save files (Re: permissions of dribble file) Carsten Bormann
  1997-03-13 19:41 ` permissions of dribble file Edward J. Sabol
  0 siblings, 2 replies; 5+ messages in thread
From: John Palmieri @ 1997-03-13 17:10 UTC (permalink / raw)


The permissions on my .newsrc-dribble file are not getting set
properly, at least not according to the documentation.  This is with
gnus-5.4.25, but I don't think this is a new problem.

Details:

Here is an excerpt from the gnus info files (node: Auto Save):

> The dribble file will get the same file
> permissions as the `.newsrc' file.

Here is an excerpt from my directory:

  /bb/palmieri:
  total 164
  -rw-------  1 palmieri     3729 Dec 18 14:01 .newsrc
  -rw-------  1 palmieri    18885 Mar 13 12:02 .newsrc.eld

Here is my dribble file:

  -rw-r--r--  1 palmieri       84 Mar 13 12:05 #.newsrc-dribble#

-- 
John H. Palmieri
Department of Mathematics, M.I.T.
palmieri@math.mit.edu
http://www-math.mit.edu/~palmieri/


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Permissions of auto-save files (Re: permissions of dribble file)
  1997-03-13 17:10 permissions of dribble file John Palmieri
@ 1997-03-13 17:35 ` Carsten Bormann
  1997-03-13 18:27   ` Karl Kleinpaste
  1997-03-13 19:41 ` permissions of dribble file Edward J. Sabol
  1 sibling, 1 reply; 5+ messages in thread
From: Carsten Bormann @ 1997-03-13 17:35 UTC (permalink / raw)
  Cc: ding, bug-gnu-emacs

John Palmieri writes:
> Here is an excerpt from the gnus info files (node: Auto Save):
> 
> > The dribble file will get the same file
> > permissions as the `.newsrc' file.
> 
> Here is an excerpt from my directory:
> 
>   /bb/palmieri:
>   total 164
>   -rw-------  1 palmieri     3729 Dec 18 14:01 .newsrc
>   -rw-------  1 palmieri    18885 Mar 13 12:02 .newsrc.eld
> 
> Here is my dribble file:
> 
>   -rw-r--r--  1 palmieri       84 Mar 13 12:05 #.newsrc-dribble#

No -- that's not your dribble file, its the auto-save file of a
not-yet-existing dribble file.

Each time we install a new version of Emacs here, we apply the
following patch (oops, this patch is reversed -- the default mode is
changed from 0666 to 0600 by the patch):

cd /home/rn-src/emacs-19.34/src/
gdiff -u /home/rn-src/emacs-19.34/src/fileio.c /home/rn-src/emacs-19.34/src/fileio.c.orig
--- /home/rn-src/emacs-19.34/src/fileio.c	Mon Sep  9 18:13:36 1996
+++ /home/rn-src/emacs-19.34/src/fileio.c.orig	Sat Jul 20 09:00:27 1996
@@ -3997,7 +3997,7 @@
     /* But make sure we can overwrite it later!  */
     auto_save_mode_bits = st.st_mode | 0600;
   else
-    auto_save_mode_bits = 0600;
+    auto_save_mode_bits = 0666;
 
   return
     Fwrite_region (Qnil, Qnil,

Diff finished at Thu Mar 13 18:23:40

This gross hack is intended to make auto-save files for buffers like
*mail* more secure -- it might help with your problem.  It also causes
auto-save files that you may want to keep accessible to be unreadable
for your colleagues.  Sigh.

Of course, Gnus could save an empty dribble file at the outset, making
this hack unnecessary *just for dribble files*.  My taste buds don't
know whether this would be less gross.

The real thing would be a way to indicate, from Emacs-Lisp, the
desired privacy mode for auto-save files for each buffer in Emacs
separately -- even those that don't have files yet (that's why I put
bug-gnu-emacs into the CC).

Gruesse, Carsten


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Permissions of auto-save files (Re: permissions of dribble file)
  1997-03-13 17:35 ` Permissions of auto-save files (Re: permissions of dribble file) Carsten Bormann
@ 1997-03-13 18:27   ` Karl Kleinpaste
  1997-03-19 23:14     ` Danny Siu
  0 siblings, 1 reply; 5+ messages in thread
From: Karl Kleinpaste @ 1997-03-13 18:27 UTC (permalink / raw)


Carsten Bormann <cabo@Informatik.Uni-Bremen.DE> writes:
> No -- that's not your dribble file, its the auto-save file of a
> not-yet-existing dribble file.
> Each time we install a new version of Emacs here, we apply the
> following patch:
...
> The real thing would be a way to indicate, from Emacs-Lisp, the
> desired privacy mode for auto-save files for each buffer in Emacs
> separately -- even those that don't have files yet (that's why I put
> bug-gnu-emacs into the CC).

Another alternative: Bury all auto-save files in a particular
directory, and then change the _directory_ mode to be 0700, thus
making irrelevant the question of what modes the files themselves
have.

(This also happens to be a major win when you're editing files in AFS
or NFS and your server departs this world for universes unknown.)

# mkdir ~/.auto
# chmod 700 ~/.auto
# cat >> .emacs
(defvar auto-save-dir "~/.auto/"
  "directory for auto-saves.  protected.")
(if (file-directory-p auto-save-dir)
    (defun make-auto-save-file-name ()
      "safe/fast place for auto-saves."
      (interactive)
      (concat auto-save-dir "#" (buffer-name (current-buffer)) "#")))
^D


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: permissions of dribble file
  1997-03-13 17:10 permissions of dribble file John Palmieri
  1997-03-13 17:35 ` Permissions of auto-save files (Re: permissions of dribble file) Carsten Bormann
@ 1997-03-13 19:41 ` Edward J. Sabol
  1 sibling, 0 replies; 5+ messages in thread
From: Edward J. Sabol @ 1997-03-13 19:41 UTC (permalink / raw)
  Cc: ding

Other people have made their suggestions. Here's what I prefer:

% mkdir ~/.private
% chmod 700 ~/.private
% mv ~/.newsrc* ~/.private/
% ln -s ~/.private/.newsrc ~/.newsrc

And add the following to your .emacs:

(setq my-private-directory (expand-file-name "~/.private"))
(setq gnus-startup-file (concat my-private-directory "/.newsrc"))

And for mail and message buffers:

(add-hook 'mail-mode-hook
  (function (lambda ()
    (let ((default-directory my-private-directory))
	    (rename-auto-save-file)))))
(add-hook 'message-mode-hook
  (function (lambda ()
    (let ((default-directory my-private-directory))
	    (rename-auto-save-file)))))

Later,
Ed


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Permissions of auto-save files (Re: permissions of dribble file)
  1997-03-13 18:27   ` Karl Kleinpaste
@ 1997-03-19 23:14     ` Danny Siu
  0 siblings, 0 replies; 5+ messages in thread
From: Danny Siu @ 1997-03-19 23:14 UTC (permalink / raw)


Karl Kleinpaste writes:

  Karl> Carsten Bormann <cabo@Informatik.Uni-Bremen.DE> writes:
  >> No -- that's not your dribble file, its the auto-save file of a
  >> not-yet-existing dribble file. Each time we install a new version of
  >> Emacs here, we apply the following patch:
  Karl> ...
  >> The real thing would be a way to indicate, from Emacs-Lisp, the desired
  >> privacy mode for auto-save files for each buffer in Emacs separately --
  >> even those that don't have files yet (that's why I put bug-gnu-emacs
  >> into the CC).

The simplest solution:

(set-default-file-modes 600)

This will set file permission bits for newly created files.

-- 
                                                                ^..^
 '/..\"                                                        ( oo )  )~
m( oo )m                                                         ,,  ,,
/=-=-=-=-=-=-=-=-=-=-=-==-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=\
|  Danny Dick-Fung Siu                http://www-leland.stanford.edu/~dsiu |
|  Reference System Group             http://www.csua.berkeley.edu/~dsiu   |
|  Adobe Systems Incorporated       E-Mail:<dsiu@alumni.eecs.berkeley.edu> |
|       "What do you expect from a         <dsiu@leland.stanford.edu>      |
|          Cal. Berkeley grad.?"           <dsiu@adobe.com>                |
\=-=-=-=-=-=-=-=-=-=-=-==-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=/


^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~1997-03-19 23:14 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1997-03-13 17:10 permissions of dribble file John Palmieri
1997-03-13 17:35 ` Permissions of auto-save files (Re: permissions of dribble file) Carsten Bormann
1997-03-13 18:27   ` Karl Kleinpaste
1997-03-19 23:14     ` Danny Siu
1997-03-13 19:41 ` permissions of dribble file Edward J. Sabol

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).