• 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
Copying files with authorization; best choice?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Copying files with authorization; best choice?


  • Subject: Copying files with authorization; best choice?
  • From: Sean McBride <email@hidden>
  • Date: Wed, 15 Jun 2011 11:17:23 -0400
  • Organization: Rogue Research Inc.

Hi all,

I need to copy files to /Library/Application Support/My Company.  For users with lesser privileges, I'll need to prompt for authorization.

(I'm not writing an installer.  But within my app, I present an open panel for a user to choose a special config file that needs to be stored where any user can read it.)

After googling, it seems the best two choices are BetterAuthorizationSample and AuthorizationExecuteWithPrivileges().

But I'm not sure which to use.

The BAS example code docs say "You should only use BetterAuthorizationSample if your application needs ongoing access to privileged operations. [...]  On the other hand, if your application needs elevated privileges for a one-off task (like installing or uninstalling), you should consider using AuthorizationExecuteWithPrivileges directly."

But the docs for AEWP say "This function poses a security concern because it will indiscriminately run any tool or application, severely increasing the security risk. You should avoid the use of this function if possible." but also "You should use this function only to allow installers to run as root".

BAS seems quite complicated, but reading between the lines it seems AEWP is discouraged.

Anyone tried both?  Any advice?

Thanks,

--
____________________________________________________________
Sean McBride, B. Eng                 email@hidden
Rogue Research                        www.rogue-research.com
Mac Software Developer              Montréal, Québec, Canada


_______________________________________________

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

  • Follow-Ups:
    • Re: Copying files with authorization; best choice?
      • From: Nick Zitzmann <email@hidden>
  • Prev by Date: Re: Coalesced updates and refresh rate
  • Next by Date: Re: Copying files with authorization; best choice?
  • Previous by thread: Re: NSDragOperation for operationNotAllowedCursor !!
  • Next by thread: Re: Copying files with authorization; best choice?
  • Index(es):
    • Date
    • Thread