s3:winbindd: fix problems with SIGCHLD handling (bug #7317)
authorStefan Metzmacher <metze@samba.org>
Thu, 1 Apr 2010 14:23:06 +0000 (16:23 +0200)
committerKarolin Seeger <kseeger@samba.org>
Thu, 6 May 2010 12:08:38 +0000 (14:08 +0200)
commitf2a20e1523440a35bb6fab00325b7c993f524b54
treec2ecac358a40cf41e938d9a16df407e66880c057
parente38e22253f3525d070b63a9236e1c84d859440c8
s3:winbindd: fix problems with SIGCHLD handling (bug #7317)

The main problem is that we call CatchChild() within the
parent winbindd, which overwrites the signal handler
that was registered by winbindd_setup_sig_chld_handler().

That means winbindd_sig_chld_handler() and winbind_child_died()
are never triggered when a winbindd domain child dies.
As a result will get "broken pipe" for all requests to that domain.

To reduce the risk of similar bugs in future we call
CatchChild() in winbindd_reinit_after_fork() now.

We also use a full winbindd_reinit_after_fork() in the
cache validation child now instead instead of just resetting
the SIGCHLD handler by hand. This will also fix possible
tdb problems on systems without pread/pwrite and disabled mmap
as we now correctly reopen the tdb handle for the child.

metze
(cherry picked from commit 73577205cf81644e7fe853eaf3e6459f7f443096)
(cherry picked from commit e0ece652956292cc67383535a0fa174b5015d91e)
(cherry picked from commit 26bdc249310b71dc45e087347e456c9f5b0f4f9b)
source3/winbindd/winbindd.c
source3/winbindd/winbindd_cm.c
source3/winbindd/winbindd_dual.c