s4-libnet: cope with an empty client site name from CLDAP
authorAndrew Tridgell <tridge@samba.org>
Tue, 27 Apr 2010 05:02:29 +0000 (15:02 +1000)
committerAndrew Tridgell <tridge@samba.org>
Tue, 27 Apr 2010 05:24:44 +0000 (15:24 +1000)
We fall back to the server site name in a vampire

Pair-Programmed-With: Andrew Bartlett <abartlet@samba.org>

source4/libnet/libnet_become_dc.c

index 6457266407aa08ebac4c5c5cd4aea22585eb26c8..74242c02d4e6af9db66c1f0c436a8bee9fc91dc4 100644 (file)
@@ -825,6 +825,11 @@ static void becomeDC_recv_cldap(struct tevent_req *req)
        DEBUG(0,("CLDAP response: forest=%s dns=%s netbios=%s server_site=%s  client_site=%s\n",
                 s->forest.dns_name, s->domain.dns_name, s->domain.netbios_name,
                 s->source_dsa.site_name, s->dest_dsa.site_name));
+       if (!s->dest_dsa.site_name || strcmp(s->dest_dsa.site_name, "") == 0) {
+               DEBUG(0,("Got empty client site - using server site name %s\n",
+                        s->source_dsa.site_name));
+               s->dest_dsa.site_name = s->source_dsa.site_name;
+       }
 
        becomeDC_connect_ldap1(s);
 }