diff options
author | Jeremy Allison <jra@samba.org> | 2006-09-06 21:43:31 +0000 |
---|---|---|
committer | Gerald (Jerry) Carter <jerry@samba.org> | 2007-10-10 11:43:57 -0500 |
commit | ccdd921e61c95e8e2d1764a74603c863ca2867ba (patch) | |
tree | 12b556fdfec9a44d1af939dd22603d113659012e /source3/nsswitch/winbindd_dual.c | |
parent | 012c9e9cf9db9147cd95e1abb0f8db0548e0a9d9 (diff) | |
download | samba-ccdd921e61c95e8e2d1764a74603c863ca2867ba.tar.gz samba-ccdd921e61c95e8e2d1764a74603c863ca2867ba.tar.bz2 samba-ccdd921e61c95e8e2d1764a74603c863ca2867ba.zip |
r18191: Fix the online/offline state handling of winbindd.
Instead of trying to do this in the winbindd_cache
entries, add a timed even handler to probe every
5 mins when disconnected.
Fix events to run all pending events, rather than
only one.
Jeremy.
(This used to be commit 7bfbe1b4fb9a91c6678035f220bbf0b4f5afdcac)
Diffstat (limited to 'source3/nsswitch/winbindd_dual.c')
-rw-r--r-- | source3/nsswitch/winbindd_dual.c | 20 |
1 files changed, 15 insertions, 5 deletions
diff --git a/source3/nsswitch/winbindd_dual.c b/source3/nsswitch/winbindd_dual.c index 55f897603c..f19672be16 100644 --- a/source3/nsswitch/winbindd_dual.c +++ b/source3/nsswitch/winbindd_dual.c @@ -576,7 +576,17 @@ static void child_msg_offline(int msg_type, struct process_id src, void *buf, si for (domain = domain_list(); domain; domain = domain->next) { DEBUG(5,("child_msg_offline: marking %s offline.\n", domain->name)); - domain->online = False; + set_domain_offline(domain); + } +} + +/* Ensure any negative cache entries with the netbios or realm names are removed. */ + +static void winbindd_flush_negative_conn_cache(struct winbindd_domain *domain) +{ + check_negative_conn_cache_timeout(domain->name, domain->dcname, 0); + if (*domain->alt_name) { + check_negative_conn_cache_timeout(domain->alt_name, domain->dcname, 0); } } @@ -599,12 +609,12 @@ static void child_msg_online(int msg_type, struct process_id src, void *buf, siz winbindd_flush_nscd_cache(); /* Mark everything online - delete any negative cache entries - to force an immediate reconnect. */ + to force a reconnect on the next query from the parent to this child. */ for (domain = domain_list(); domain; domain = domain->next) { DEBUG(5,("child_msg_online: marking %s online.\n", domain->name)); - domain->online = True; - check_negative_conn_cache_timeout(domain->name, domain->dcname, 0); + set_domain_online(domain); + winbindd_flush_negative_conn_cache(domain); } } @@ -614,7 +624,7 @@ static const char *collect_onlinestatus(TALLOC_CTX *mem_ctx) char *buf = NULL; if ((buf = talloc_asprintf(mem_ctx, "global:%s ", - get_global_winbindd_state_online() ? + get_global_winbindd_state_offline() ? "Offline":"Online")) == NULL) { return NULL; } |