The branch, v3-5-test has been updated via bc30dc6... s3:winbindd: make "smbcontrol winbindd validate-cache" reliable again via 284f94b... s3:winbindd: remove unused variables via e7b9c14... s3:winbindd: fix problems with SIGCHLD handling (bug #7317) from 39dbf73... s3-docs: Fix typo in man idmap_ad.
http://gitweb.samba.org/?p=samba.git;a=shortlog;h=v3-5-test - Log ----------------------------------------------------------------- commit bc30dc6983835ee376125861a5450975cc5af2ff Author: Stefan Metzmacher <me...@samba.org> Date: Thu Apr 8 12:45:54 2010 +0200 s3:winbindd: make "smbcontrol winbindd validate-cache" reliable again commit 73577205cf81644e7fe853eaf3e6459f7f443096 (s3:winbindd: fix problems with SIGCHLD handling (bug #7317)) broke this. metze (cherry picked from commit eb9b7d0363669574de8ec380089407890f15eac2) commit 284f94b01d70db2e55dd8c1f3f8a353c1b4c1b8e Author: Stefan Metzmacher <me...@samba.org> Date: Thu Apr 1 18:10:47 2010 +0200 s3:winbindd: remove unused variables metze (cherry picked from commit e18ddb6036f5e0a2211e89a7c9b5514c30a653cf) commit e7b9c148d6fe155bd8afb8ff9b148eaf4092ff4e Author: Stefan Metzmacher <me...@samba.org> Date: Thu Apr 1 16:23:06 2010 +0200 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) ----------------------------------------------------------------------- Summary of changes: source3/winbindd/winbindd.c | 17 +++++------------ source3/winbindd/winbindd_cm.c | 3 --- source3/winbindd/winbindd_dual.c | 6 +++--- 3 files changed, 8 insertions(+), 18 deletions(-) Changeset truncated at 500 lines: diff --git a/source3/winbindd/winbindd.c b/source3/winbindd/winbindd.c index 300c78e..9c676f0 100644 --- a/source3/winbindd/winbindd.c +++ b/source3/winbindd/winbindd.c @@ -372,8 +372,6 @@ static void winbind_msg_validate_cache(struct messaging_context *msg_ctx, { uint8 ret; pid_t child_pid; - struct sigaction act; - struct sigaction oldact; DEBUG(10, ("winbindd_msg_validate_cache: got validate-cache " "message.\n")); @@ -383,7 +381,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) { @@ -401,16 +398,12 @@ static void winbind_msg_validate_cache(struct messaging_context *msg_ctx, /* child */ + if (!winbindd_reinit_after_fork(NULL)) { + _exit(0); + } + /* 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); + CatchSignal(SIGCHLD, SIG_DFL); 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 62466f8..34c1a39 100644 --- a/source3/winbindd/winbindd_cm.c +++ b/source3/winbindd/winbindd_cm.c @@ -179,9 +179,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 beeeeb2..44e8552 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]); -- Samba Shared Repository