deleting a file

Joachim Schrod jschrod at acm.org
Thu Jan 10 02:21:07 UTC 2008


Nils Kassube wrote:
> Paul wrote:
>> On Jan 9, 2008 3:26 PM, Nils Kassube <kassube at gmx.net> wrote:
>> > Soo-Hyun Choi wrote:
>> > > accidentally, i have changed a file permission to 600 with root
>> > > privilege. since then, i cannot delete this file.
>> >
>> > Is the directory of the file writeable?
>>
>> Does the original poster need to give himself ownership of the file
>> with chown?
> 
> The owner of a directory may delete any file within that directory, even 
> if it is owned by root. However the directory must be writeable for the 
> owner of the directory. OTOH, root can delete every file whatever 
> permissions the directory has.

To elaborate further (I'm sure Nils knows it, but for the rest of 
us). Since Choi used sudo, the OTOH case slipped in.

If he would have tried to delete the file with his own account, a 
writable directory is not always sufficient. If the directory has 
the +t access bit set, only owners of files can delete them. E.g., 
that's the case in /tmp/. (As Nils wrote, that doesn't bind root, 
though. Therefore I would assume a case of ro mount, ACLs, or 
immutable attribs here. Or a network share.)

	Joachim

-- 
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
Joachim Schrod				Email: jschrod at acm.org
Roedermark, Germany





More information about the ubuntu-users mailing list