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>
Mon, 17 May 2010 07:50:11 +0000 (09:50 +0200)
commit853e2a8b8a1aea8c6cee1a6232a5d641c1fee6cd
tree4d94c300d8136ab8c3947c9f222d86c381771799
parent2862e0e5b316348d9ca942f855949022b9bb4fc3
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 e7b9c148d6fe155bd8afb8ff9b148eaf4092ff4e)
source3/winbindd/winbindd.c
source3/winbindd/winbindd_cm.c
source3/winbindd/winbindd_dual.c