[PATCH] Fix bug #10831 - SIGCLD Signal handler not correctly reinstalled on old library code use - smbrun etc.
ira at samba.org
Wed Sep 24 09:02:25 MDT 2014
Please do not push..
As always... reviews with comments take longer ;)
On Tue, Sep 23, 2014 at 8:22 PM, Martin Schwenke <martin at meltin.net> wrote:
> On Tue, 23 Sep 2014 15:44:25 -0700, Jeremy Allison <jra at samba.org>
> > Some of the old library util code can
> > overwrite the SIGCHLD signal handler
> > carefully set up by smbd and winbindd
> > via tevent :-(.
> > It's used in blocking calls when launching
> > scripts as in smbrun(), but it leaves
> > the new handler in place when it exits
> > from smbrun(), rather than restoring
> > the original signal handler.
> > The first patch changes CatchChild()
> > and CatchChildLeaveStatus() to return
> > the existing handler so it can be
> > saved and restored.
> > The second patch fixes smbrun() and
> > the change password code (which
> > also invokes a child process) to
> > store and restore the existing
> > handler.
> > Review most appreciated !
> Today I learned about:
> * signal handling; and
> * functions that return function pointers (without using a typedef).
> Just out of interest, since it is only the CatchChildLeaveStatus() calls
> that causes problems, why bother changing CatchChild()? I looked over
> the various calls to CatchChild() and they seem OK.
> I'm happy to say...
> Reviewed-by: Martin Schwenke <martin at meltin.net>
> However, I won't push in case you decide that CatchChild() doesn't need
> to be changed and/or you want to increase confidence by getting a
> review from someone who didn't learn about these things today... ;-)
> peace & happiness,
More information about the samba-technical