From d3f1d7f7b670ce59c2349f2687ae3f6708be3254 Mon Sep 17 00:00:00 2001 From: Tim Potter Date: Thu, 19 Jul 2001 09:18:23 +0000 Subject: Merged across rewritten version of winbindd_kill_connections(). This now works much better with trusted domains whose DCs cannot be reached. I'm pretty impressed with how much faster winbindd is in HEAD rather than TNG. A lot fewer unecessary name lookups are performed and it feels a lot zippier now. (This used to be commit 36413784aec5819c83e5e469ce4c7bb5d468e980) --- source3/nsswitch/winbindd_util.c | 37 +++++++++++++++---------------------- 1 file changed, 15 insertions(+), 22 deletions(-) (limited to 'source3/nsswitch') diff --git a/source3/nsswitch/winbindd_util.c b/source3/nsswitch/winbindd_util.c index 4c7071d063..bdcf076acc 100644 --- a/source3/nsswitch/winbindd_util.c +++ b/source3/nsswitch/winbindd_util.c @@ -223,40 +223,33 @@ BOOL domain_handles_open(struct winbindd_domain *domain) void winbindd_kill_connections(struct winbindd_domain *domain) { - BOOL is_server = False; - struct winbindd_domain *server_domain = NULL, *tmp; + /* Kill all connections */ - /* Find pointer to domain of pdc */ + if (!domain) { + struct winbindd_domain *tmp; - for (tmp = domain_list; tmp != NULL; tmp = tmp->next) { - if (strequal(domain->name, tmp->name)) { - server_domain = tmp; - break; - } - } - - if (!server_domain) return; - - /* If NULL passed, use pdc */ - - if (!domain) { - domain = server_domain; - } + for (tmp = domain_list; tmp; tmp = tmp->next) { + winbindd_kill_connections(domain); + } - if (domain == server_domain || - strequal(domain->name, lp_workgroup())) { - is_server = True; - } + return; + } /* Log a level 0 message - this is probably a domain controller failure */ + if (!domain->controller[0]) + return; + DEBUG(0, ("killing connections to domain %s with controller %s\n", domain->name, domain->controller)); debug_conn_state(); - if (is_server) { + /* Close LSA connections if we are killing connections to the dc + that has them open. */ + + if (strequal(server_state.controller, domain->controller)) { server_state.pwdb_initialised = False; server_state.lsa_handle_open = False; wb_lsa_close(&server_state.lsa_handle); -- cgit