Re: execute system("some script") on behalf of root from non-root app
Re: execute system("some script") on behalf of root from non-root app
- Subject: Re: execute system("some script") on behalf of root from non-root app
- From: eveningnick eveningnick <email@hidden>
- Date: Thu, 6 Jan 2011 17:43:07 +0200
>Search google is not an answer, although a good suggestion. Could you please post the solution you came up with to the >list. There are many ways to skin this cat, I think we would all benefit from your experience.
Every process that is running on a system has two user id numbers -
effective UID and real UID. The first identifies what a process can do
(privileges), the latter says, who had launched this process. they are
often the same for a usual process, but may differ in the case when
the executable has suid bit set (then the real UID will be the one of
the user who launched the process, and effective UID will be the one
of the owner of this file, thus a process can do things that the owner
of the file would be able to do, even though its launched by a
different user), or if a process has been launched via
AuthorizationExecuteWithPrivileges.
When one is calling launchctl, it checks real UID and, depending on if
it is 0 or not, it talks either to system-wide instance of launchd or
to session-wide.
having an effective UID of root means that you can do root-like
operations, for ex. execute setuid(0) which would change your real UID
to 0 - i.e. to root. After that your helper process can talk to
system-wide instance of launchd.
I tried sudo before, it didn't work for me - in System Console i kept
getting password requests.
2011/1/5 Shawn Bakhtiar <email@hidden>:
>
>
> Search google is not an answer, although a good suggestion. Could you please post the solution you came up with to the list. There are many ways to skin this cat, I think we would all benefit from your experience.
>
> Correct. You are NOT running them as root, but you can easily tell the script to "sudo su" and go from there, which in effect will make you root.
>
> Also have you looked at making the uninstaller be an apple script?
>
> Also does any one know if there is a setup program like there use to be on Windows (IE Nullsoft)?
>
>
>> Date: Wed, 5 Jan 2011 21:40:09 +0200
>> From: email@hidden
>> To: email@hidden
>> CC: email@hidden
>> Subject: Re: execute system("some script") on behalf of root from non-root app
>>
>> Thanks Nick, i really should've googled before asking.
>> _______________________________________________
>>
>> 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
_______________________________________________
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