> I want to allow my cocoa app to be only launched by root/admin users.
> How can i achieve this?

As I think has already been mentioned, the UNIX approach is to set the 
application's owner as root and then make it only executable by the owner. 
However, Apple largely discourages programmers from developing Cocoa apps that 
will be run with root privileges.

A better approach, if possible, is to factor out the section of code that needs 
to be run with root privilege (e.g., to read a protected file or open a network 
tap) and place that in a command line helper tool. The Cocoa app then runs with 
normal privileges. When the program needs to perform the privileged operation 
it calls that helper app (think of it as a kind of remote procedure call).

Look up Apple's BetterAuthorizationSample code for how to do this.

Todd

_______________________________________________

Cocoa-dev mailing list ([email protected])

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 [email protected]

Reply via email to