Thread View: gnu.emacs.vm.bug
1 messages
1 total messages
Started by Eyvind Ness
Wed, 11 Nov 1992 08:10
Re: VM problem?
Author: Eyvind Ness
Date: Wed, 11 Nov 1992 08:10
Date: Wed, 11 Nov 1992 08:10
68 lines
2924 bytes
2924 bytes
| Date: Tue, 10 November 1992, 22:30 GMT
| From: Gilbert Harman
|
| In checking whether my INBOX~ folder was global readable, I
| discovered it was not but that almost all my vm folders are
| readable, no doubt because my umask is 022. Is there a way
| to get new vm folders not to be global readable if I want my
| permissions to be more permissive for most new files?
How about utilising GNU Emacs' write-file-hooks variable:
(setq vm-mode-hooks '(vm-mode-init))
(defun vm-mode-init ()
(our-mail-mode-local-variables)
;; From bottom of vm.el:
(or (memq 'vm-write-file-hook write-file-hooks)
(setq write-file-hooks
(cons 'vm-write-file-hook write-file-hooks))))
(defun our-mail-mode-local-variables ()
(make-local-variable 'make-backup-files)
(make-local-variable 'write-file-hooks)
(setq write-file-hooks '(mail-chmod-exit-hook))
(setq make-backup-files nil))
(defun mail-chmod-exit-hook ()
(condition-case c
(prog1 t
(let* ((write-file-hooks nil) ;ignore other hooks
(cmd2 "/bin/chgrp")
(options2 "other")
(umask ?\37) ;octal - strip off last 5 bits
(file (buffer-file-name))
(modes (file-modes file)))
(set-file-modes file (logand modes (lognot umask)))
(save-buffer)
;; NB! no hooks for save-buffer - otherwise a recursive call.
;; For NFS backups - make sure root has read access:
(call-process cmd2 nil nil nil options2 file)))
(error
;; Make sure we always return nil if this code crashes so that other
;; write-file-hooks get called.
(prog1 nil
(message "%s" c) (sit-for 5)))))
I have the same umask as you have, 022, but this does not affect the
above code at all (in fact it uses #'set-file-modes to explicitly set
the folder permissions).
Hope this helps.
Cheers,
Eyvind.
~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~
Eyvind Ness Internet: Eyvind.Ness@HRP.No
Research Scientist Voicenet: +47 9 183100 ext. 275
CRS Division Faxnet: +47 9 187109
OECD HRP Papernet: PO Box 173, N-1751 Halden, Norway
~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~
- Listen, I know that your friends are my friends and vice versa. I've
thought about that. You can have them.
(Bret Easton Ellis, American Psycho)
Thread Navigation
This is a paginated view of messages in the thread with full content displayed inline.
Messages are displayed in chronological order, with the original post highlighted in green.
Use pagination controls to navigate through all messages in large threads.
Back to All Threads