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??? Rick On Wed, 2003-08-27 at 16:18, zentara wrote:
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.
This is where my machine differs. My file is now owned by root:root, and if I open it with vi as user zentara:user, vi says it is opened "readonly". "zz" [readonly] 0L, 0C
The only thing I can think is happening is that you may still be in the root shell when you start vi. I would be very unhappy if my system did what your's is doing. I can see why you are baffled.
I'm using fvwm2, maybe some others can test your procedure, but I'm afraid they will get the same results as me.
Something has got to be wrong in your system. I would guess that markh is in the /etc/sudoers listed as root for vi.