I have a directory named dir1dir1, owned by rootroot, with permissions 777 set777. I have a file named file1file1 inside of dir1dir1, owned by rootroot, with permissions 644 set644. I'm logged in as a normal user named user1user1.
Why is it that if I edit file1file1 inside vim, which states that it is a readonly file, I can save it via 'wq!'wq!? My expectation is that unless I sudosudo in, I ought to be denied write access.
I have noticed that following the edit, the ownership of file1file1 has changed from rootroot to user1user1. I also noticed, if I change dir1dir1 permission to 775775, my expectations are met. That is, I am denied write access.