• 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: Allow only root/admin users to execute the cocoa app
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Allow only root/admin users to execute the cocoa app


  • Subject: Re: Allow only root/admin users to execute the cocoa app
  • From: Todd Heberlein <email@hidden>
  • Date: Sun, 24 Jan 2010 13:31:05 -0800

> 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@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: Allow only root/admin users to execute the cocoa app
      • From: vincent habchi <email@hidden>
References: 
 >Allow only root/admin users to execute the cocoa app (From: Arun <email@hidden>)

  • Prev by Date: Re: UIButton's Sender Control Events
  • Next by Date: Re: UIButton's Sender Control Events
  • Previous by thread: Re: Allow only root/admin users to execute the cocoa app
  • Next by thread: Re: Allow only root/admin users to execute the cocoa app
  • Index(es):
    • Date
    • Thread