smartssa at gmail.com
Fri Oct 21 13:46:49 UTC 2005
On 10/21/05, Jens <commercial at acamedia.org> wrote:
> something strange happened yesterday and id like to get some help
> understanding it. i was showing a friend how permissions work and did this:
> as user eg. joe:
> cd ~/
> mkdir test
> chmod og-rwx test
> cd test
> sudo touch file
> sudo chmod og-rwx file
> now heres whats STRANGE:
> rm -f file
> and the file is deleted...this means that user joe deleted a file owned
> by root with 700 permissions.
> this def. seems counterintutitive to me but id very much appreciate
> being corrected.
> thanks, jens
Nevermind, that was easier than I thought.
A user can delete files in a directory they own regardless of that
file's permissions because the file is linked to the parent directory
and 'rm' is esentially translates into 'unlink from this directory'.
Since Joe has rwx on the directory, he can do as he pleases. Does
that make sense?
If you don't want joe to be able to delete a file, but able to read,
make sure root owns the parent folder.
If you omit the -f, you will get a warning about 'write protected' file(s).
~ Darryl ~ smartssa at gmail.com
http://smartssa.com / http://darrylclarke.com
More information about the ubuntu-users