Moved -ve cache check to correct place.
authorJeremy Allison <jra@samba.org>
Tue, 24 Sep 2002 22:56:59 +0000 (22:56 +0000)
committerJeremy Allison <jra@samba.org>
Tue, 24 Sep 2002 22:56:59 +0000 (22:56 +0000)
Jeremy.

source/nsswitch/winbindd_cm.c

index 0b9e38eb1f2511121fd74e1ceaf685ca8f85e8e9..01f556988930463a2db301e2725f0ddd876c24e7 100644 (file)
@@ -382,16 +382,6 @@ static NTSTATUS cm_open_connection(const char *domain,const char *pipe_name,
        fstrcpy(new_conn->domain, domain);
        fstrcpy(new_conn->pipe_name, pipe_name);
        
-       /* Look for a domain controller for this domain.  Negative results
-          are cached so don't bother applying the caching for this
-          function just yet.  */
-
-       if (!cm_get_dc_name(domain, new_conn->controller, &dc_ip)) {
-               result = NT_STATUS_DOMAIN_CONTROLLER_NOT_FOUND;
-               add_failed_connection_entry(new_conn, result);
-               return result;
-       }
-               
        /* Return false if we have tried to look up this domain and netbios
           name before and failed. */
 
@@ -423,6 +413,16 @@ static NTSTATUS cm_open_connection(const char *domain,const char *pipe_name,
                return result;
        }
 
+       /* Look for a domain controller for this domain.  Negative results
+          are cached so don't bother applying the caching for this
+          function just yet.  */
+
+       if (!cm_get_dc_name(domain, new_conn->controller, &dc_ip)) {
+               result = NT_STATUS_DOMAIN_CONTROLLER_NOT_FOUND;
+               add_failed_connection_entry(new_conn, result);
+               return result;
+       }
+               
        /* Initialise SMB connection */
 
        cm_get_ipc_userpass(&ipc_username, &ipc_domain, &ipc_password);