Re: Unix Privileges on deleting
Re: Unix Privileges on deleting
- Subject: Re: Unix Privileges on deleting
- From: Ondra Cada <email@hidden>
- Date: Fri, 28 Jun 2002 12:54:45 +0200
On Thursday, June 27, 2002, at 07:57 , Lorenzo Puleo wrote:
I have a file "byJohn" owned by "john" (group "unknown") which has "none"
privileges for owner, group and everyone.
If I logged in as "robert", I should NOT be able to delete that file,
since
Wrong. File permissions have nothing to do with deletion: they control
your ability to change, read, or execute the file, and deleting it you do
nothing of that.
it has "none" for owner, group and everyone. Instead I can delete it, and
I
did it. Also, the API isDeletableFileAtPath tells me that file is really
deletable.
The file "byJohn" is inside a folder "A" which has "ReadAndWrite"
privileges
for owner, group and everyone. Is this the reason why I was able to delete
that file?
Right. Deleting a file you change the folder in which it resides (seems to
me pretty intuitive, is it not?!?). Therefore, this folder's permissions
control deletion (and renaming and adding other files). It's as simple as
this:
r: you can read the contents, of file or of a folder (means you can list
what's inside);
w: you can modify the contents, of file or of a folder (means you can add/
rename/delete file names from it);
x: you can use the contents, means run the file as application or a script,
or use the folder to descend to anything it contains.
Slightly more complicated might get t and s bits, but you bump into them
rarely enough in OSX.
---
Ondra Cada
OCSoftware: email@hidden
http://www.ocs.cz
private email@hidden
http://www.ocs.cz/oc
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.