s3-winbindd: Close netlogon connection if the status returned by the NetrSamLogonEx...
authorMatthieu Patou <mat@matws.net>
Fri, 24 Feb 2012 22:06:02 +0000 (14:06 -0800)
committerKarolin Seeger <kseeger@samba.org>
Wed, 29 Feb 2012 19:57:11 +0000 (20:57 +0100)
If not the child process would hang for quite a long time up to the
moment when the connection is cleaned by the kernel (took ~ 20 minutes)
in my tests.

Fix bug #8771 (Winbind takes up to 20 minutes to change from DC 1 to DC 2 and
in the meantime to respond NT_STATUS_IO_TIMEOUT).

source3/winbindd/winbindd_pam.c

index 5c56b8731ab5838faf5bfe5a2d83bf50c11a19ad..26fdc5a409a9bfad3ce463036eae1356e1e0fe89 100644 (file)
@@ -2101,6 +2101,15 @@ enum winbindd_result winbindd_dual_pam_auth_crap(struct winbindd_domain *domain,
 
 done:
 
+       if (NT_STATUS_EQUAL(result, NT_STATUS_IO_TIMEOUT)) {
+               DEBUG(3,("winbindd_dual_pam_auth_crap: sam_network_logon(ex) "
+                               "returned NT_STATUS_IO_TIMEOUT after the retry."
+                               "We didn't know what's going on killing "
+                               "connections to domain %s\n",
+                               name_domain));
+               invalidate_cm_connection(&contact_domain->conn);
+       }
+
        /* give us a more useful (more correct?) error code */
        if ((NT_STATUS_EQUAL(result, NT_STATUS_DOMAIN_CONTROLLER_NOT_FOUND) ||
            (NT_STATUS_EQUAL(result, NT_STATUS_UNSUCCESSFUL)))) {