Wrong security attributes. Maybe a bug?

Bryn M. Reeves bmr at redhat.com
Mon Jan 19 19:14:27 UTC 2009


Joshua C. wrote:
> 2009/1/19 Ralf Ertzinger <fedora at camperquake.de>:
>> This has been the way of UNIX since the dawn of time. Deleting a file
>> is a directory operation, so the permissions on the directory apply,
>> not the permissions on the file.
>>
>> You should not be able to modify the file in place, however (but
>> you could delete it and create a new one, which would be owned by
>> you and not root).
> 
>  I think this concers only deleting a file. But I shouldn't be allowed
> to rename it, should I? in kde3 I couldn't delete those files. why?
> 

Renaming in unix-like file systems is equivalent to linking the file 
into the directory with a new name and then removing the old one. 
Still a directory level operation.

Try this:

[bmr at bmr ~]# su -
Password:
[root at bmr bmr]# umask 066
[root at bmr bmr]# touch pony
[root at bmr bmr]# su - bmr
[bmr at bmr ~]$ mv pony not-yours
[bmr at bmr ~]$ ll not-yours
-rw------- 1 root root 0 2009-01-19 19:08 not-yours
[bmr at bmr ~]$ cat not-yours
cat: not-yours: Permission denied
[bmr at bmr ~]$ rm not-yours
rm: remove write-protected regular empty file `not-yours'? y
[bmr at bmr ~]$ ll not-yours
ls: cannot access not-yours: No such file or directory

I can move (rename), or delete, but not access this file.

Regards,
Bryn.




More information about the fedora-devel-list mailing list