confusing permission behaviour

James Livingston jrl at ids.org.au
Thu Oct 20 12:05:21 UTC 2005


On Thu, 2005-10-20 at 13:48 +0200, Jens wrote:
> to reproduce as user joe:
> cd ~/
> mkdir test
> cd test
> sudo touch file
> sudo chown root:root file
> sudo chmod og-rwx file
> 
> now - this is what is puzzling - as ordinary user joe:
> rm -f file
> 
> and after asking for permission linux allows user joe to delete a file to
> which he has no write permission - let alone read or execute.

This works because user joe has write permission on the "test"
directory. Deleting files doesn't any involve the permissions on the
file, it involves the write permission of the directory it is in.

There is an exception to this however: if a directory has the sticky(t)
bit set, files in the directory can only be deleted by the owner of the
file (and root). This is normally used on the /tmp directory, so that
users can't affect other users temporary files.


Cheers,

James "Doc" Livingston
--
And for the important things in life: "If you teach a child to read, he
or her can pass a literacy test" -- George "Dubya" Boosh - president of
the Yoonited States.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 189 bytes
Desc: This is a digitally signed message part
URL: <https://lists.ubuntu.com/archives/ubuntu-users/attachments/20051020/9f130b85/attachment.sig>


More information about the ubuntu-users mailing list