s4-libnet: fixed forest DNS name
authorAndrew Tridgell <tridge@samba.org>
Wed, 24 Aug 2011 03:51:01 +0000 (13:51 +1000)
committerAndrew Tridgell <tridge@samba.org>
Wed, 24 Aug 2011 21:39:39 +0000 (07:39 +1000)
Pair-Programmed-With: Andrew Bartlett <abartlet@samba.org>

source4/libnet/libnet_become_dc.c
source4/libnet/py_net.c

index bfa637255c21f932375157e1519e7210ca964654..34ca97c2747104cbf24d1aece2db3b600c7140f7 100644 (file)
@@ -2935,7 +2935,7 @@ static void becomeDC_drsuapi_update_refs_send(struct libnet_BecomeDC_state *s,
 
        ntds_dns_name = talloc_asprintf(r, "%s._msdcs.%s",
                                        ntds_guid_str,
-                                       s->domain.dns_name);
+                                       s->forest.dns_name);
        if (composite_nomem(ntds_dns_name, c)) return;
 
        r->in.bind_handle               = &drsuapi->bind_handle;
index c4b684077c8c1a194e17805d405920cf65fc12ee..cf2f0660811e7339728b6e1aba07c19a1d34ba2f 100644 (file)
@@ -32,6 +32,7 @@
 #include "librpc/rpc/pyrpc_util.h"
 #include "libcli/finddc.h"
 #include "libcli/resolve/resolve.h"
+#include "dsdb/common/proto.h"
 
 void initnet(void);
 
@@ -447,7 +448,7 @@ static PyObject *py_net_replicate_init(py_net_Object *self, PyObject *args, PyOb
                return NULL;
        }
 
-       s->forest.dns_name = lpcfg_dnsdomain(lp);
+       s->forest.dns_name = samdb_dn_to_dns_domain(s, ldb_get_root_basedn(samdb));
 
        s->chunk.gensec_skey = &s->gensec_skey;
        s->chunk.partition = &s->partition;