On May 5, 2010, at 8:49 AM, Ken Thomases wrote:

> Another technique is outlined in the BetterAuthorizationSample sample code:
> 
> http://developer.apple.com/mac/library/samplecode/BetterAuthorizationSample/Introduction/Intro.html


I'm just going to come out and say it, that I just could not understand what 
the heck that code was doing and why. I read everything twice. It's a bajillion 
lines of sample code, and since *we all know how much you can trust Apple 
sample code to be correct,* there was no way I was going to use it as is. I 
don't think I could figure out at the time what needed to be done to make sure 
it was working correctly either.

My solution was to use AuthorizationExecuteWithPrivileges from within my GUI 
app to run whatever I need. Apparently that's the wrong way, but the "right" 
way confused the snot out of me.  In my case, I have code in my application to 
install and load a kext on demand, and unload and uninstall. That involves 
authenticating to run kextload/unload, cp, rm, and chown. It works, and instead 
of being *thousands* of lines of code, it's under 200. But I'd still rather do 
it the right way if it wasn't so insane.


--
Seth Willits



_______________________________________________

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Reply via email to