can't delete a file although permissions seem correct

Jeff Vian jvian10 at charter.net
Wed Dec 8 13:28:04 UTC 2004


On Wed, 2004-12-08 at 15:02 +0200, Marius Andreiana wrote:
> Hi
> 
> I've encountered a weird situation where I can't delete a file:
> (reproductile on rh9 and fc3, no selinux)
> 
> $ id
> uid=500(marius) gid=500(marius) groups=500(marius)
> 
> mkdir d1
> >d1/a.txt
> chmod 571 d1
> chmod 460 d1/*
> ls -al d1/
> total 12
> dr-xrwx--x   2 marius marius 4096 Dec  8 15:01 .
> drwxrwxrwt  17 root   root   4096 Dec  8 15:01 ..
> -r--rw----   1 marius marius    0 Dec  8 15:01 a.txt
> 
> rm d1/a.txt
> rm: remove write-protected regular empty file `d1/a.txt'? y
> rm: cannot remove `d1/a.txt': Permission denied
> 
> The directory d2 has write permissions for my group, and file it's
> writable by group. I belong to that group, why can't the file be
> removed?
> 
> Thanks in advance for enlightenment

There is precedence in applying permissions, and they are not additive.
If the user is allowed/denied any permission, that is the applicable
permissions used.

In other words; If you are the user, ONLY the user permissions are
applied.  If you are not the user, but are a member of the group, then
ONLY the group permissions apply.  If you are not the user, AND are not
a member of the group, then only the other permissions apply  





More information about the fedora-list mailing list