Mailing Lists: Apple Mailing Lists
Image of Mac OS face in stamp
Re: Re: reparent a process spawned with launchd or setuid
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Re: reparent a process spawned with launchd or setuid



On Aug 17, 2009 9:21pm, Wim Lewis <email@hidden> wrote:
> On Aug 17, 2009, at 8:40 AM, Simon Strandgaard wrote:
>
[snip]
>
> As far as I know it isn't possible to reparent a process. It might be possible to put your launchd-launched process in the same process group as your application using setpgid() --- I don't know.
>

I have tried setpgid() as root, but it refuses to change group id for the process.
I can't remember my conclusion to why it didn't work. I think it was that
reparenting is only possible upwards in the process hierarchy.
Downward is not possible, which I hope that I am wrong about.


[snip]
> IIRC, it's possible to ask launchd to kill one of its jobs, which might be another approach.

I have 3 different programs. A worker program. A launchd program. A GUI program.
I spawn between 2 and 4 worker processes via my launchd program by invoking posix_spawn().
When the workers have been started, the launchd program goes back to sleep.
The spawn takes less than 100 msec, so its not a long running job.

All this is for a file manager, so when there is a filesystem timeout the affected process can be killed.
Root is needed so I can browse around in the /var folder and go through all the mounted /Volumes.

I originally thought about having just a single launchd process, but I ran into some
problems with the BAS code combined with distributed objects and throttling.
I can't remember why I made that decision.


I just want to make sure I don't open a big security hole.


>
> There's probably a better list for this question, since it doesn't actually involve CDSA or crypto. :)
[snip]


Would the darwin-dev list be ok?




--
Simon Strandgaard
http://graphicdesignertoolbox.com/
 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Apple-cdsa mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

References: 
 >Re: reparent a process spawned with launchd or setuid (From: Wim Lewis <email@hidden>)



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2011 Apple Inc. All rights reserved.