[PATCH] casperd should detach from controlling session

Crest crest at rlwinm.de
Fri Mar 14 09:38:44 UTC 2014



On 13.03.2014 22:08, Xin Li wrote:
> Hi, Pawel,
> 
> I have noticed that casperd's child (zygote) would still use 
> controlling session from parent.  This can be observed by running
> ps -ax on systems running casperd, where the child have a spurious 
> console associated.
> 
> The attached patch would fix it.  May I commit it against -HEAD?
> 
> By the way, the zygote child also closes file descriptor 4 twice 
> (harmless; it's either sp[0] or the /dev/null which is closed
> before starting zygote_main, or before returning from stdnull().
> Based on the construct of the code, I believe both close() can be
> omitted.  If this makes sense I'll submit a new patch.

Wouldn't this patch break support for external monitoring e.g. by
daemontools. By convention a daemontools run script is started with
its own process group and execs into the service. If a service tries
to unconditionally create its own process group it will fail.


More information about the freebsd-security mailing list