Re: Running an App as Root
Re: Running an App as Root
- Subject: Re: Running an App as Root
- From: OL&L Dev 2 <email@hidden>
- Date: Tue, 4 Nov 2003 18:23:39 -0800
Also, be sure to read Apple's Technote entitled "Authorization for
Everyone". This technote in detail describes how to make your app
behave in a user-friendly manner and also discusses the authorization
popup dialog issues.
James
At 7:01 PM -0600 11/4/03, Chris Hanson wrote:
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.