• 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: Running an App as Root
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Running an App as Root


  • Subject: Re: Running an App as Root
  • From: Chris Hanson <email@hidden>
  • Date: Tue, 4 Nov 2003 19:01:43 -0600

On Nov 4, 2003, at 4:43 PM, David Blanton wrote:
How can I distribute an app that will run as Root? I want to run scripts
(chmod, chown) from the app that require Root privileges using NSTask.

You don't. What you do is distribute an application that runs as a normal user, but that includes a helper tool that can be invoked uusing the Security framework that performs tightly-constrained tasks as root. This is what displays the standard authentication panel to users.

See Apple's sample code on their developer web site -- AuthSample and MoreAuthSample -- and the documentation for the Security framework for more details on how to actually do this. And be sure to understand exactly how AuthSample and MoreAuthSample actually work before leaping into your own code.

-- Chris

--
Chris Hanson, bDistributed.com, Inc. | Email: email@hidden
Outsourcing Vendor Evaluation | Phone: +1-847-372-3955
Custom Mac OS X Development | Fax: +1-847-589-3738
http://bdistributed.com/ | Personal Email: email@hidden
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.

  • Follow-Ups:
    • Re: Running an App as Root
      • From: David Blanton <email@hidden>
    • Re: Running an App as Root
      • From: OL&L Dev 2 <email@hidden>
References: 
 >Running an App as Root (From: David Blanton <email@hidden>)

  • Prev by Date: Xcode 1.0.1 through Software Update
  • Next by Date: Re: Newbie threading design question
  • Previous by thread: Running an App as Root
  • Next by thread: Re: Running an App as Root
  • Index(es):
    • Date
    • Thread