summaryrefslogtreecommitdiffstats
path: root/source/winbindd/winbindd_dual.c
diff options
context:
space:
mode:
authorBo Yang <boyang@novell.com>2009-01-05 16:19:48 -0800
committerKarolin Seeger <kseeger@samba.org>2009-01-08 16:26:16 +0100
commit7db39201adef6b1579b2f62e3ee95b0311cbf643 (patch)
tree6318294e0f13c3924f28986927da3c2a64ce8abb /source/winbindd/winbindd_dual.c
parentcfc6aeb90b2fdcbac090aeb828e1f1ab1fa5231f (diff)
downloadsamba-7db39201adef6b1579b2f62e3ee95b0311cbf643.tar.gz
samba-7db39201adef6b1579b2f62e3ee95b0311cbf643.tar.xz
samba-7db39201adef6b1579b2f62e3ee95b0311cbf643.zip
clean event context after child is forked.
Signed-off-by: Stefan Metzmacher <metze@samba.org> (cherry picked from commit ada3145ffe40dfbe89f968e844bfb139a58eab5d)
Diffstat (limited to 'source/winbindd/winbindd_dual.c')
-rw-r--r--source/winbindd/winbindd_dual.c40
1 files changed, 24 insertions, 16 deletions
diff --git a/source/winbindd/winbindd_dual.c b/source/winbindd/winbindd_dual.c
index d200cfcf6b6..6a8601d4ff0 100644
--- a/source/winbindd/winbindd_dual.c
+++ b/source/winbindd/winbindd_dual.c
@@ -1177,7 +1177,8 @@ static bool fork_domain_child(struct winbindd_child *child)
state.sock = fdpair[0];
close(fdpair[1]);
- if (!reinit_after_fork(winbind_messaging_context(), true)) {
+ if (!reinit_after_fork(winbind_messaging_context(),
+ winbind_event_context(), true)) {
DEBUG(0,("reinit_after_fork() failed\n"));
_exit(0);
}
@@ -1219,27 +1220,34 @@ static bool fork_domain_child(struct winbindd_child *child)
messaging_register(winbind_messaging_context(), NULL,
MSG_DEBUG, debug_message);
+ primary_domain = find_our_domain();
+
+ if (primary_domain == NULL) {
+ smb_panic("no primary domain found");
+ }
+ /* we have destroy all time event in reinit_after_fork()
+ * set check_online_event to NULL */
+ for (domain = domain_list(); domain; domain = domain->next) {
+ domain->check_online_event = NULL;
+ }
+ /* It doesn't matter if we allow cache login,
+ * try to bring domain online after fork. */
if ( child->domain ) {
child->domain->startup = True;
child->domain->startup_time = time(NULL);
- }
-
- /* Ensure we have no pending check_online events other
- than one for this domain or the primary domain. */
-
- for (domain = domain_list(); domain; domain = domain->next) {
- if (domain->primary) {
- primary_domain = domain;
- }
- if ((domain != child->domain) && !domain->primary) {
- TALLOC_FREE(domain->check_online_event);
+ /* we can be in primary domain or in trusted domain
+ * If we are in trusted domain, set the primary domain
+ * in start-up mode */
+ if (!(child->domain->internal)) {
+ set_domain_online_request(child->domain);
+ if (!(child->domain->primary)) {
+ primary_domain->startup = True;
+ primary_domain->startup_time = time(NULL);
+ set_domain_online_request(primary_domain);
+ }
}
}
- if (primary_domain == NULL) {
- smb_panic("no primary domain found");
- }
-
/* Ensure we're not handling an event inherited from
our parent. */