On Wed, 27 Aug 2003 16:33:52 -0400
Rick Friedman
I followed Mark's instructions and had the same result he did.
As you say, vi says the file is opened "readonly". However, within vi, when I press "i" to insert, vi then says, "W10: Warning: Changing a readonly file". Then when I do ":w!", it writes it out, changing the ownership in the process.
Did you go so far as to actually try to write it out???
Ok, I see what is happening, it has to do with directory permissions. It did like you said, it wrote the file and changed permissions to user:users. But this is what is happening. The owner of a directory (you in your homedir) has the right to delete any file in it. So what vi does is open the file owned by root, and when you try to save it, it deletes the root file, and creates a new one owned by user:users. Try the same thing with /home/xx instead of /home/markh/xx vi will not let you save it, because /home is owned by root. -- I'm not really a human, but I play one on earth.