s4-libnet: make it possible to join "off-site".
[samba.git] / source4 / libnet / libnet_site.c
index af105b78ea634fa998c5022555af8e70fcdf7704..691e4b243acb1f3df5309c28fefed9cbc512f1f7 100644 (file)
@@ -78,7 +78,8 @@ NTSTATUS libnet_FindSite(TALLOC_CTX *ctx, struct libnet_context *lctx, struct li
        }
        status = cldap_netlogon(cldap, tmp_ctx, &search);
        if (!NT_STATUS_IS_OK(status)
-           || !search.out.netlogon.data.nt5_ex.client_site) {
+           || search.out.netlogon.data.nt5_ex.client_site == NULL
+           || search.out.netlogon.data.nt5_ex.client_site[0] == '\0') {
                /*
                  If cldap_netlogon() returns in error,
                  default to using Default-First-Site-Name.