summaryrefslogtreecommitdiff
path: root/source3/winbindd/winbindd_dual.c
diff options
context:
space:
mode:
authorStefan Metzmacher <metze@samba.org>2010-04-01 16:23:06 +0200
committerStefan Metzmacher <metze@samba.org>2010-04-01 17:25:11 +0200
commit73577205cf81644e7fe853eaf3e6459f7f443096 (patch)
tree94f71502024f44977177f7b83cb192f2bbe2de11 /source3/winbindd/winbindd_dual.c
parent3475c61179b87fa5c48ffe24c2793137ad04c318 (diff)
downloadsamba-73577205cf81644e7fe853eaf3e6459f7f443096.tar.gz
samba-73577205cf81644e7fe853eaf3e6459f7f443096.tar.bz2
samba-73577205cf81644e7fe853eaf3e6459f7f443096.zip
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
Diffstat (limited to 'source3/winbindd/winbindd_dual.c')
-rw-r--r--source3/winbindd/winbindd_dual.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/source3/winbindd/winbindd_dual.c b/source3/winbindd/winbindd_dual.c
index ca6af1f37b..eb9ace23d6 100644
--- a/source3/winbindd/winbindd_dual.c
+++ b/source3/winbindd/winbindd_dual.c
@@ -1215,6 +1215,9 @@ bool winbindd_reinit_after_fork(const char *logfilename)
logfilename))
return false;
+ /* Stop zombies in children */
+ CatchChild();
+
/* Don't handle the same messages as our parent. */
messaging_deregister(winbind_messaging_context(),
MSG_SMB_CONF_UPDATED, NULL);
@@ -1338,9 +1341,6 @@ static bool fork_domain_child(struct winbindd_child *child)
DEBUG(10, ("Child process %d\n", (int)sys_getpid()));
- /* Stop zombies in children */
- CatchChild();
-
state.sock = fdpair[0];
close(fdpair[1]);