[launchd-dev] Talk to correct launchd

Per Olofsson per.olofsson at gu.se
Mon Feb 4 06:15:49 PST 2013


4 feb 2013 kl. 14:50 skrev Rolf Howarth <rolf at squarebox.co.uk>:

> Hi,
> 
> I have a launch daemon in /Library/LaunchDaemons and want to let users
> manually start and stop the service from my application's user
> interface, which involves them authenticating of course.
> 
> I am therefore running launchctl with an effective uid of 0 but their
> own real user id. I believe launchctl uses the EUID to decide which
> launchd to talk to, and so it's talking to the wrong (per user, not
> system) launchd.
> 
> Is there any way to get launchd to use the EUID instead of RUID and
> force it to talk to the system-wide root launchd instead?


Can't you just setuid() before calling launchctl? This way RUID == EUID == 0.

-- 
Per Olofsson, IT-service, University of Gothenburg



More information about the launchd-dev mailing list