Author: jra
Date: 2006-12-08 18:07:44 +0000 (Fri, 08 Dec 2006)
New Revision: 20082

WebSVN: 
http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=rev&root=samba&rev=20082

Log:
When fork_domain_child is forked when we're offline
the child inherits *all* active check_online timout handlers.
This is bad when it's not our domain (ie. BUILTIN).
Jeremy.

Modified:
   branches/SAMBA_3_0/source/nsswitch/winbindd_dual.c
   branches/SAMBA_3_0_24/source/nsswitch/winbindd_dual.c


Changeset:
Modified: branches/SAMBA_3_0/source/nsswitch/winbindd_dual.c
===================================================================
--- branches/SAMBA_3_0/source/nsswitch/winbindd_dual.c  2006-12-08 18:06:38 UTC 
(rev 20081)
+++ branches/SAMBA_3_0/source/nsswitch/winbindd_dual.c  2006-12-08 18:07:44 UTC 
(rev 20082)
@@ -755,6 +755,7 @@
 {
        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 @@
                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;

Modified: branches/SAMBA_3_0_24/source/nsswitch/winbindd_dual.c
===================================================================
--- branches/SAMBA_3_0_24/source/nsswitch/winbindd_dual.c       2006-12-08 
18:06:38 UTC (rev 20081)
+++ branches/SAMBA_3_0_24/source/nsswitch/winbindd_dual.c       2006-12-08 
18:07:44 UTC (rev 20082)
@@ -755,6 +755,7 @@
 {
        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 @@
                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;

Reply via email to