summaryrefslogtreecommitdiffstats
path: root/source/winbindd/winbindd_dual.c
diff options
context:
space:
mode:
authorJeremy Allison <jra@samba.org>2008-05-14 14:10:39 -0700
committerJeremy Allison <jra@samba.org>2008-05-14 14:10:39 -0700
commit8d701a142be2b75dc30ad215bc178af902eb4af9 (patch)
treebeff2122f6365d19e9adee7ffd0b333b872d83f4 /source/winbindd/winbindd_dual.c
parent15857534b76bc66ad122510100aa224f17250465 (diff)
downloadsamba-8d701a142be2b75dc30ad215bc178af902eb4af9.tar.gz
samba-8d701a142be2b75dc30ad215bc178af902eb4af9.tar.xz
samba-8d701a142be2b75dc30ad215bc178af902eb4af9.zip
Fix bug #5464. Pointed out by Herb @ Connectathon. In fork_domain_child() we call :
CatchChild(); *before* we fork the domain child. This call establishes a signal handler that eats SIGCLD signals and doesn't call sys_select_signal() as the main daemon SIGCLD handler should do. This causes the parent to ignore dead children and time out, instead of calling winbind_child_died() on receipt of the signal. The correct fix is to move the CatchChild call into the child code after the fork. Jeremy.
Diffstat (limited to 'source/winbindd/winbindd_dual.c')
-rw-r--r--source/winbindd/winbindd_dual.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/source/winbindd/winbindd_dual.c b/source/winbindd/winbindd_dual.c
index 1d741be79ea..d46580155c0 100644
--- a/source/winbindd/winbindd_dual.c
+++ b/source/winbindd/winbindd_dual.c
@@ -982,9 +982,6 @@ static bool fork_domain_child(struct winbindd_child *child)
ZERO_STRUCT(state);
state.pid = sys_getpid();
- /* Stop zombies */
- CatchChild();
-
child->pid = sys_fork();
if (child->pid == -1) {
@@ -1006,6 +1003,9 @@ static bool fork_domain_child(struct winbindd_child *child)
/* Child */
+ /* Stop zombies in children */
+ CatchChild();
+
state.sock = fdpair[0];
close(fdpair[1]);