r20082: When fork_domain_child is forked when we're offline
authorJeremy Allison <jra@samba.org>
Fri, 8 Dec 2006 18:07:44 +0000 (18:07 +0000)
committerGerald (Jerry) Carter <jerry@samba.org>
Wed, 10 Oct 2007 17:16:23 +0000 (12:16 -0500)
the child inherits *all* active check_online timout handlers.
This is bad when it's not our domain (ie. BUILTIN).
Jeremy.
(This used to be commit 8d815ec4c103a83ef7cea0ae5fc64681f6bcb48a)

source3/nsswitch/winbindd_dual.c

index d8215ac90db5a4d5994bff11efb4fd788bcf39c3..7a699edb251d47a75f7afa8e71f638f7887db3b0 100644 (file)
@@ -755,6 +755,7 @@ static BOOL fork_domain_child(struct winbindd_child *child)
 {
        int fdpair[2];
        struct winbindd_cli_state state;
+       struct winbindd_domain *domain;
        extern BOOL override_logfile;
 
        if (socketpair(AF_UNIX, SOCK_STREAM, 0, fdpair) != 0) {
@@ -844,6 +845,16 @@ static BOOL fork_domain_child(struct winbindd_child *child)
                child->domain->startup_time = time(NULL);
        }
 
+       for (domain = domain_list(); domain; domain = domain->next) {
+               if (domain != child->domain) {
+                       /* Ensure we have no "check_online" events pending
+                          that are not on this domain. */
+                       if (domain->check_online_event) {
+                               TALLOC_FREE(domain->check_online_event);
+                       }
+               }
+       }
+
        while (1) {
 
                int ret;