]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
Merged across rewritten version of winbindd_kill_connections(). This now
authorTim Potter <tpot@samba.org>
Thu, 19 Jul 2001 09:18:23 +0000 (09:18 +0000)
committerTim Potter <tpot@samba.org>
Thu, 19 Jul 2001 09:18:23 +0000 (09:18 +0000)
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.

source/nsswitch/winbindd_util.c

index 4c7071d06338b70e4921d5d0007a9315be59d04a..bdcf076acc4f38d5c4f71aa424a52a0390c2f470 100644 (file)
@@ -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);