s3: Correctly handle timeouts for the ping-dc operation
authorVolker Lendecke <vl@samba.org>
Wed, 16 Dec 2009 16:22:48 +0000 (17:22 +0100)
committerMichael Adam <obnox@samba.org>
Wed, 10 Mar 2010 12:22:23 +0000 (13:22 +0100)
When a DC is too slow responding to the logonCtrl operation, we have to
invalidate the connection. Right now we can not recover from that condition
very well.

source3/winbindd/winbindd_misc.c

index 65e3f25edef1b69411049ada5354879bf01289c4..463e8375c84e5952aa35e06a3f0d2ab90f79b2c4 100644 (file)
@@ -133,6 +133,12 @@ enum winbindd_result winbindd_dual_ping_dc(struct winbindd_domain *domain,
                                          logon_server, NETLOGON_CONTROL_QUERY,
                                          2, &info, &werr);
 
+       if (NT_STATUS_EQUAL(status, NT_STATUS_IO_TIMEOUT)) {
+               DEBUG(2, ("rpccli_netr_LogonControl timed out\n"));
+               invalidate_cm_connection(&contact_domain->conn);
+               return WINBINDD_ERROR;
+       }
+
        if (!NT_STATUS_EQUAL(status, NT_STATUS_CTL_FILE_NOT_SUPPORTED)) {
                DEBUG(2, ("rpccli_netr_LogonControl returned %s, expected "
                          "NT_STATUS_CTL_FILE_NOT_SUPPORTED\n",