1

How does vim steal root owned files?

view story
linux-howto

http://unix.stackexchange.com – Witness the following: sh-3.2$ mkdir testcase sh-3.2$ cd testcase sh-3.2$ sudo touch temp sh-3.2$ ls -al total 0 drwxr-xr-x 3 glen staff 102 19 Dec 12:38 . drwxr-xr-x 12 glen staff 408 19 Dec 12:38 .. -rw-r--r-- 1 root staff 0 19 Dec 12:38 temp sh-3.2$ echo nope > temp sh: temp: Permission denied sh-3.2$ vim temp # inside vim itheivery # press [ESC] :wq! # vim exits sh-3.2$ ls -al total 8 drwxr-xr-x 3 glen staff 102 19 Dec 12:38 . drwxr-xr-x 12 glen staff 408 19 Dec 12:38 .. -rw-r--r-- 1 glen staff 7 19 Dec 12:38 temp Somehow vim has taken this root-owned fil (HowTos)