s3: Try to avoid dns searches with an empty site
authorVolker Lendecke <vl@samba.org>
Mon, 9 Nov 2009 16:06:48 +0000 (17:06 +0100)
committerVolker Lendecke <vl@samba.org>
Mon, 9 Nov 2009 16:24:46 +0000 (17:24 +0100)
source3/libsmb/dsgetdcname.c

index 180547063a46a50ffbf5fc9e2b9469119984bd99..76a52c8923a07cc13a784db3fea8285466830308 100644 (file)
@@ -1138,7 +1138,7 @@ NTSTATUS dsgetdcname(TALLOC_CTX *mem_ctx,
                return NT_STATUS_INVALID_PARAMETER;
        }
 
                return NT_STATUS_INVALID_PARAMETER;
        }
 
-       if (!site_name) {
+       if ((site_name == NULL) || (site_name[0] == '\0')) {
                query_site = sitename_fetch(domain_name);
        } else {
                query_site = SMB_STRDUP(site_name);
                query_site = sitename_fetch(domain_name);
        } else {
                query_site = SMB_STRDUP(site_name);