 |
 |
Running cocoa .app as root
|
 |
|
 |
|
Fresh-Faced Recruit
Join Date: Jan 2004
Status:
Offline
|
|
I'm having trouble running a cocoa .app as root. Basicially, what I want to have is a "launcher" application that, when opened, will give the user an option to launch my program as an administrator, or normally. I've looked through Apple's security examples, but I was unable to get the .app to launch. I want to follow Apple's security guidelines, so I don't want to pass the username/password to the terminal or anything. I'd like the program to behave basically like Brian Hill's Pseudo program. I'm assuming I'd need to use LaunchCFMapp, or something along those lines. Any help or ideas will be appreciated.
Nick
|
|
|
| |
|
|
|
 |
|
 |
|
Professional Poster
Join Date: Sep 1999
Location: Ottawa, ON, Canada
Status:
Offline
|
|
Originally posted by Cybergoat:
I'm having trouble running a cocoa .app as root. Basicially, what I want to have is a "launcher" application that, when opened, will give the user an option to launch my program as an administrator, or normally. I've looked through Apple's security examples, but I was unable to get the .app to launch. I want to follow Apple's security guidelines, so I don't want to pass the username/password to the terminal or anything. I'd like the program to behave basically like Brian Hill's Pseudo program. I'm assuming I'd need to use LaunchCFMapp, or something along those lines. Any help or ideas will be appreciated.
Nick
What about using the SetUID bit on the executable?
|
|
|
| |
|
|
|
 |
|
 |
|
Fresh-Faced Recruit
Join Date: Jan 2004
Status:
Offline
|
|
The only problem with using the setUID bit is that when the program is moved after installation, the bit is turned off, and would require extra programming to reset it. As I previously posted, I'd also like to give the user the option to launch the program as root or not, so thus I don't think using the setUID bit is the best path.
Nick
|
|
|
| |
|
|
|
 |
|
 |
|
Addicted to MacNN
Join Date: Mar 2000
Location: London, UK
Status:
Offline
|
|
You shouldn't run applications as root. The applications should factor out any privileged code into a helper application. 
|
|
|
| |
|
|
|
 |
|
 |
|
Fresh-Faced Recruit
Join Date: Jan 2004
Status:
Offline
|
|
I understand that the application should not be run as root, but for this situation, be it the application itself, or the helper application, I need to be able to run it as root.
Nick
|
|
|
| |
|
|
|
 |
|
 |
|
Grizzled Veteran
Join Date: Apr 2001
Status:
Offline
|
|
Authentication services provides the ability for your program to acquire root permissions.
I haven't used it, so I can't help, but if you've been unable to figure it out, you need to keep trying - that's the right way to do it.
Wade
|
|
|
| |
|
|
|
 |
|
 |
|
Addicted to MacNN
Join Date: Mar 2000
Location: London, UK
Status:
Offline
|
|
|
|
|
|
| |
|
|
|
 |
 |
|
 |
|
|
|
|
|

|
|
 |
Forum Rules
|
 |
 |
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
|
HTML code is Off
|
|
|
|
|
|
 |
 |
 |
 |
|
 |
|