Fix bug #5464. Pointed out by Herb @ Connectathon. In fork_domain_child() we call :
authorJeremy Allison <jra@samba.org>
Wed, 14 May 2008 21:12:14 +0000 (14:12 -0700)
committerJeremy Allison <jra@samba.org>
Wed, 14 May 2008 21:12:14 +0000 (14:12 -0700)
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.

source/nsswitch/winbindd_dual.c

index 937924da3916b01103d6416f1ac836f54645a9cf..1d4d312eeef418d596188b0091df8a69c4a05e52 100644 (file)
@@ -897,9 +897,6 @@ static BOOL fork_domain_child(struct winbindd_child *child)
        ZERO_STRUCT(state);
        state.pid = sys_getpid();
 
-       /* Stop zombies */
-       CatchChild();
-
        /* Ensure we don't process messages whilst we're
           changing the disposition for the child. */
        message_block();
@@ -928,6 +925,9 @@ static BOOL fork_domain_child(struct winbindd_child *child)
 
        /* Child */
 
+       /* Stop zombies in children */
+       CatchChild();
+
        state.sock = fdpair[0];
        close(fdpair[1]);