I suggest that I have a log file with 666 permission and its owner is alice. So user 'bob' can change its owner by this:
cp log log.temp; rm log; mv log.temp log
So how can I fix this risk?
migrated from stackoverflow.com Jan 9 '13 at 8:23
This question came from our site for professional and enthusiast programmers.
As Andrey says above, bob can only do what you say if he has rights over the directory which contains the file. Just change the dir permissions to xx5 if you want bob to access but being unable to create new files.
Access permissions for files and folders mean different things from the user standpoint.