Fascinating. I just followed your instructions below and... sure enough... the same thing happened. It DOES indeed overwrite and change ownership of the pre-existing file! That does not make me happy! Rick On Wed, 2003-08-27 at 15:16, Mark Hounschell wrote:
Ok let me clearify exactly what to do to see this "anomaly"
In your home directory, as you (markh) create a file.
touch /home/markh/xx
then: ls -al /home/markh/xx -rw-r--r-- 1 markh users 0 2003-08-27 12:23 /home/markh/xx Ok the file is owned by me...
then as root: chown root /home/markh/xx chgrp root /home/markh/xx then ^d to leave root
then ls -al /home/markh/xx -rw-r--r-- 1 root root 0 2003-08-27 12:23 /home/markh/xx
Ok the file is now owned by root no?
Now as user (markh) use vi to edit the file. enter some text and write it back. You will have to use :w! command. The write should fail but does not.
The file is now owned by markh again.
ls -al /home/markh/xx -rw-r--r-- 1 markh users 22 2003-08-27 15:12 /home/markh/xx