[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Gain owner of a file using vim :w!



On Thu, 23 May 2013 00:50:01 +0200, Beco wrote:

> Dear users,
> 
> I'm astonished by this (maybe I'm naive and I'm missing something).
> 
> Yesterday as root I saved a file skel.bashrc in my /home/beco user,
> owned by root, group root.
> 
> Today I edited it, logged as beco, and vi told me "warning, read only!".
> I edited anyway, just to test, and saved with :w!
> 
> After that I checked the file and it has changed to owner beco, group
> beco.
> 
> How is that possible?
> 
> Thanks,
> Beco

Did you want the modified file to remain owned by root?  That would, of course,
be _more_ dangerous!


Reply to: