Re: Copying files with authorization; best choice?
Re: Copying files with authorization; best choice?
- Subject: Re: Copying files with authorization; best choice?
- From: Ken Thomases <email@hidden>
- Date: Wed, 15 Jun 2011 10:50:54 -0500
On Jun 15, 2011, at 10:35 AM, Nick Zitzmann wrote:
> On Jun 15, 2011, at 9:17 AM, Sean McBride wrote:
>
>> 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().
>
> You'll probably get a better answer on the apple-cdsa list, since that list is for discussion of the Security framework. But if you're just going to make a one-off invocation of /bin/cp or some other tool in /bin or /usr/bin or /sbin or whatever, then using AEWP() to directly invoke the tool is probably going to be okay. The danger in AEWP() is executing something that might do something malicious, but I think you can trust that what's installed in /bin isn't going to trigger a r00tkit.
Something else to consider is the authopen tool <http://developer.apple.com/library/mac/#documentation/Darwin/Reference/ManPages/man1/authopen.1.html>.
Cheers,
Ken
_______________________________________________
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