• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Unix Privileges on deleting
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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.
References: 
 >Unix Privileges on deleting (From: Lorenzo Puleo <email@hidden>)

  • Prev by Date: Re: What's STILL wrong with "symbol" fonts?
  • Next by Date: Error in NSReadThemeImageFromRsrc !!!! What is this ?
  • Previous by thread: Re: Unix Privileges on deleting
  • Next by thread: Saving NSTableView data
  • Index(es):
    • Date
    • Thread