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

2013-07-29 Thread Kevin Chadwick
> I'm not sure how this works. What were the permissions on the file before you > edited it? Yeah, you sure your not accessing an sftp with suid dir permissions. I get permission denied. Also setting chattr +ias on a file as root prevents the folder shenanigans On OpenBSD setting chflags schg

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

2013-05-23 Thread Frank Miles
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 "warni

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

2013-05-22 Thread Andrei POPESCU
[sent privately by mistake] On Mi, 22 mai 13, 19:48:37, 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, a

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

2013-05-22 Thread John Hasler
Joe Riel writes: > You have write permission to the directory, so you can delete the file > and create a new one, with yourself as the owner. That is, > essentially, what vi is doing. Note that if the file had had a hardlink in another directory, say one owned by root, that link (and therefor the

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

2013-05-22 Thread Joe Riel
Beco writes: > 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, j

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

2013-05-22 Thread Paul Condon
On 05/22/2013 04:48 PM, 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 edit

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

2013-05-22 Thread staticsafe
On Wed, May 22, 2013 at 07:48:37PM -0300, 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 "

Gain owner of a file using vim :w!

2013-05-22 Thread Beco
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