🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: gnu.emacs.vm.bug
Article #133

Re: INBOX file saved with wrong user na

#133
From: Scott Weikart
Date: Tue, 22 Dec 1992 21:41
29 lines
1787 bytes
> I am using VM version 5.32 beta and I noticed the following problem : 
> While reading my mail as "su", VM opens my INBOX file and gets my new mail
> (if any), but when exiting, the INBOX file and modified folders are saved
> under name "root".

Actually, my earlier posted fix only covered your INBOX, it didn't cover
creating new folders.  So, I wrote the following routine:

  (defun chown-root-file (file)
    "If we're root, chown FILE to vm-user-login-name else (user-login-name).
  Also, make sure the file is only readable and writable by owner."
    (if (eq (user-uid) 0)
	(call-process "chown" nil nil nil
		      (or (and (boundp 'vm-user-login-name) vm-user-login-name)
			  (user-login-name))
		      file))
    (set-file-modes file 384))		;o600, i.e. only readable by owner

and then call it after all calls to write-region or save-buffer (which seems
to cover all the places in VM 4.41, at least).

Note that I use vm-user-login-name and vm-user-full-name to read mail from one
of the other accounts I'm responsible for (as a system administrator with the
root password).

Scott Weikart			Community Data Processing (CdP): 415-322-9069
Internet: scott@igc.apc.org	Bitnet: scott%igc.apc.org@stanford
UUCP Mail Net: uunet!cdp!scott
Technical Details
Message-ID: <1400600002@igc.apc.org>
Path: arc1-ca.pugleaf.net!sparky!uunet!spool.mu.edu!darwin.sura.net!sgiblab!sgigate!sgi!cdp!scott
References: <CYRIL.92Nov27115952@mercure.cosm>

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!sparky!uunet!spool.mu.edu!darwin.sura.net!sgiblab!sgigate!sgi!cdp!scott
From: Scott Weikart <scott@igc.apc.org>
Newsgroups: gnu.emacs.vm.bug
Date: 22 Dec 92 13:41 PST
Subject: Re: INBOX file saved with wrong user na
Sender: Notesfile to Usenet Gateway <notes@igc.apc.org>
Message-ID: <1400600002@igc.apc.org>
References: <CYRIL.92Nov27115952@mercure.cosm>
Nf-ID: #R:CYRIL.92Nov27115952@mercure.cosm:1663849568:cdp:1400600002:000:1246
Nf-From: cdp.UUCP!scott    Dec 22 13:41:00 1992
Lines: 30