summaryrefslogtreecommitdiff
path: root/source3/nsswitch
diff options
context:
space:
mode:
authorTim Potter <tpot@samba.org>2001-07-19 09:18:23 +0000
committerTim Potter <tpot@samba.org>2001-07-19 09:18:23 +0000
commitd3f1d7f7b670ce59c2349f2687ae3f6708be3254 (patch)
tree6d70b60ddd4d23ba5f2dd91d0375ad0e2212d807 /source3/nsswitch
parent921761fb979922af3f9b1b20266a0cbd766792eb (diff)
downloadsamba-d3f1d7f7b670ce59c2349f2687ae3f6708be3254.tar.gz
samba-d3f1d7f7b670ce59c2349f2687ae3f6708be3254.tar.bz2
samba-d3f1d7f7b670ce59c2349f2687ae3f6708be3254.zip
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)
Diffstat (limited to 'source3/nsswitch')
-rw-r--r--source3/nsswitch/winbindd_util.c37
1 files changed, 15 insertions, 22 deletions
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);