• 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: Removing folder from /Applications
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Removing folder from /Applications


  • Subject: Re: Removing folder from /Applications
  • From: Jean-Daniel Dupas <email@hidden>
  • Date: Tue, 8 Jul 2008 23:52:09 +0200


Le 8 juil. 08 à 21:59, Chris Hanson a écrit :

On Jul 8, 2008, at 11:19 AM, Nick Zitzmann wrote:

On Jul 8, 2008, at 6:20 AM, Glover,David wrote:

		myStatus = AuthorizationCopyRights (myAuthorizationRef,
&myRights, kAuthorizationEmptyEnvironment, myFlags, NULL);

		if ([NSFm removeFileAtPath: (NSString *)
@"/Applications/Folder" handler: nil] == NO)


You can't elevate the privileges of an existing task; you can only remove them. So you need to call AuthorizationExecuteWithPrivileges() to run some other program with privileges that deletes the folder.

DO NOT do that.

You need to follow the recipe in the Authorization Services documentation and sample code to SECURELY implement a helper tool that can be called upon to perform the privileged operation.

The helper tool SHOULD NOT be invoked via AuthorizationExecuteWithPrivileges. That call should ONLY be used as described in the Authorization Services documentation. Any other use puts the security of the user's system at risk.

Yes, it's a bit of a roundabout way to accomplish your goal. But it's necessary to maintain system security.

-- Chris

For simple tasks like this one, send Apple Event to the Finder. It will take care of authoriztions for you.


Attachment: smime.p7s
Description: S/MIME cryptographic signature

_______________________________________________

Cocoa-dev mailing list (email@hidden)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

References: 
 >Removing folder from /Applications (From: "Glover,David" <email@hidden>)
 >Re: Removing folder from /Applications (From: Robert Cerny <email@hidden>)
 >RE: Removing folder from /Applications (From: "Glover,David" <email@hidden>)
 >Re: Removing folder from /Applications (From: Nick Zitzmann <email@hidden>)
 >Re: Removing folder from /Applications (From: Chris Hanson <email@hidden>)

  • Prev by Date: IKImageView in mode IKToolModeCrop issue
  • Next by Date: Re: Working with Paragraphs in Core Text
  • Previous by thread: Re: Removing folder from /Applications
  • Next by thread: Calculating accurate bounds of stroked paths
  • Index(es):
    • Date
    • Thread