home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #31 / NN_1992_31.iso / spool / gnu / emacs / vm / bug / 679 next >
Encoding:
Text File  |  1992-12-23  |  1.7 KB  |  43 lines

  1. Path: sparky!uunet!spool.mu.edu!darwin.sura.net!sgiblab!sgigate!sgi!cdp!scott
  2. From: Scott Weikart <scott@igc.apc.org>
  3. Newsgroups: gnu.emacs.vm.bug
  4. Date: 22 Dec 92 13:41 PST
  5. Subject: Re: INBOX file saved with wrong user na
  6. Sender: Notesfile to Usenet Gateway <notes@igc.apc.org>
  7. Message-ID: <1400600002@igc.apc.org>
  8. References: <CYRIL.92Nov27115952@mercure.cosm>
  9. Nf-ID: #R:CYRIL.92Nov27115952@mercure.cosm:1663849568:cdp:1400600002:000:1246
  10. Nf-From: cdp.UUCP!scott    Dec 22 13:41:00 1992
  11. Lines: 30
  12.  
  13.  
  14. > I am using VM version 5.32 beta and I noticed the following problem : 
  15. > While reading my mail as "su", VM opens my INBOX file and gets my new mail
  16. > (if any), but when exiting, the INBOX file and modified folders are saved
  17. > under name "root".
  18.  
  19. Actually, my earlier posted fix only covered your INBOX, it didn't cover
  20. creating new folders.  So, I wrote the following routine:
  21.  
  22.   (defun chown-root-file (file)
  23.     "If we're root, chown FILE to vm-user-login-name else (user-login-name).
  24.   Also, make sure the file is only readable and writable by owner."
  25.     (if (eq (user-uid) 0)
  26.     (call-process "chown" nil nil nil
  27.               (or (and (boundp 'vm-user-login-name) vm-user-login-name)
  28.               (user-login-name))
  29.               file))
  30.     (set-file-modes file 384))        ;o600, i.e. only readable by owner
  31.  
  32. and then call it after all calls to write-region or save-buffer (which seems
  33. to cover all the places in VM 4.41, at least).
  34.  
  35. Note that I use vm-user-login-name and vm-user-full-name to read mail from one
  36. of the other accounts I'm responsible for (as a system administrator with the
  37. root password).
  38.  
  39. Scott Weikart            Community Data Processing (CdP): 415-322-9069
  40. Internet: scott@igc.apc.org    Bitnet: scott%igc.apc.org@stanford
  41. UUCP Mail Net: uunet!cdp!scott
  42.  
  43.