Path: utzoo!utgpu!watserv1!watmath!uunet!bu.edu!bu-cs!snorkelwacker!tut.cis.ohio-state.edu!HPSRDMO.HP.COM!darrylo From: darrylo@HPSRDMO.HP.COM (Darryl Okahata) Newsgroups: gnu.emacs Subject: Re: Unwanted chown's done on files being edited Message-ID: <9002080709.AA29836@hpsrdmo.HP.COM> Date: 8 Feb 90 07:09:46 GMT References: <541@massey.ac.nz> Sender: daemon@tut.cis.ohio-state.edu Distribution: gnu Organization: GNUs Not Usenet Lines: 41 Ken Spagnolo writes: > We have 18.55 running on a Pyramid 90x and some DECstation 3100's. > When I save a file that I've been editing as root, the owner of that > file becomes root, regardless of what it was to start with. What a > pain this is. This was not the case when we were running 18.51, nor > did I knowingly do anything at compile time to include or disable this > "feature" in either case. A brief look thru the source shows that > chown is called only as a command in dired mode. I suspect that the variable `make-backup-files' is non-nil, and that the variables `backup-by-copying' and `backup-by-copying-when-mismatch' are both nil. What is probably happening is that, when you write out the file, Emacs renames the *original* file to that of the backup filename (whatever it is) and then proceeds to write out the file. As the original file was renamed, the newly written file gets "root" ownerships (this is not a problem with just "root" -- you'll have similar problems with other accounts). To solve this problem, you have a number of choices: 1. Disable backups. 2. Set the variable `backup-by-copying-when-mismatch' to `t'. From the documentation for this variable: Non-nil means create backups by copying if this preserves owner or group. Renaming may still be used (subject to control of other variables) when it would not result in changing the owner or group of the file; that is, for files which are owned by you and whose group matches the default for a new file created there by you. This variable is relevant only if backup-by-copying is nil. 3. Set the variable `backup-by-copying' to `t'. -- Darryl Okahata UUCP: {hplabs!, hpcea!, hpfcla!} hpnmd!darrylo Internet: darrylo%hpnmd@hpcea.HP.COM DISCLAIMER: this message is the author's personal opinion and does not constitute the support, opinion or policy of Hewlett-Packard or of the little green men that have been following him all day.