Mark Hounschell wrote:
zentara wrote:
On Wed, 27 Aug 2003 12:28:57 -0400 Mark Hounschell
wrote: I have a file -rw-r--r-- 1 root root 149811 2003-08-07 17:49 xx
As a regular user I edit the file. Make some changes and write it back. Now the file is -rw-r--r-- 1 markh users 149811 2003-08-27 12:23 xx
Am I missing something? Why was I able to write the file? Why was its owner and project changed from root to the users? Do the directory permissions override the file permissions? I must be missing something????
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 And no my machine has not been hacked. Also I have 3 machines here now and more at work all running 8.2 that do the same thing. ?????? Still confused Mark