summaryrefslogtreecommitdiff
path: root/source3/winbindd
diff options
context:
space:
mode:
Diffstat (limited to 'source3/winbindd')
-rw-r--r--source3/winbindd/winbindd.c14
-rw-r--r--source3/winbindd/winbindd_cm.c3
-rw-r--r--source3/winbindd/winbindd_dual.c6
3 files changed, 6 insertions, 17 deletions
diff --git a/source3/winbindd/winbindd.c b/source3/winbindd/winbindd.c
index 13cadffab8..d1d33d39f8 100644
--- a/source3/winbindd/winbindd.c
+++ b/source3/winbindd/winbindd.c
@@ -407,7 +407,6 @@ static void winbind_msg_validate_cache(struct messaging_context *msg_ctx,
* so we don't block the main winbindd and the validation
* code can safely use fork/waitpid...
*/
- CatchChild();
child_pid = sys_fork();
if (child_pid == -1) {
@@ -425,16 +424,9 @@ static void winbind_msg_validate_cache(struct messaging_context *msg_ctx,
/* child */
- /* install default SIGCHLD handler: validation code uses fork/waitpid */
- ZERO_STRUCT(act);
- act.sa_handler = SIG_DFL;
-#ifdef SA_RESTART
- /* We *want* SIGALRM to interrupt a system call. */
- act.sa_flags = SA_RESTART;
-#endif
- sigemptyset(&act.sa_mask);
- sigaddset(&act.sa_mask,SIGCHLD);
- sigaction(SIGCHLD,&act,&oldact);
+ if (!winbindd_reinit_after_fork(NULL)) {
+ _exit(0);
+ }
ret = (uint8)winbindd_validate_cache_nobackup();
DEBUG(10, ("winbindd_msg_validata_cache: got return value %d\n", ret));
diff --git a/source3/winbindd/winbindd_cm.c b/source3/winbindd/winbindd_cm.c
index c2df244568..c013fae787 100644
--- a/source3/winbindd/winbindd_cm.c
+++ b/source3/winbindd/winbindd_cm.c
@@ -180,9 +180,6 @@ static bool fork_child_dc_connect(struct winbindd_domain *domain)
pid_t parent_pid = sys_getpid();
char *lfile = NULL;
- /* Stop zombies */
- CatchChild();
-
if (domain->dc_probe_pid != (pid_t)-1) {
/*
* We might already have a DC probe
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]);