summaryrefslogtreecommitdiff
path: root/source4/scripting
diff options
context:
space:
mode:
authorAmitay Isaacs <amitay@gmail.com>2012-02-02 16:08:26 +1100
committerAmitay Isaacs <amitay@gmail.com>2012-02-21 23:08:35 +1100
commit597449235e4835bb406d40c7574993200363997b (patch)
treeab911940b09967fd4d5213f15e81331989362095 /source4/scripting
parent9b9fdeefb47f2657c9bb4c2f48318550da510209 (diff)
downloadsamba-597449235e4835bb406d40c7574993200363997b.tar.gz
samba-597449235e4835bb406d40c7574993200363997b.tar.bz2
samba-597449235e4835bb406d40c7574993200363997b.zip
s4-provision: dns: Do not re-calculate ntdsguid, use from names
Diffstat (limited to 'source4/scripting')
-rw-r--r--source4/scripting/python/samba/provision/sambadns.py16
1 files changed, 1 insertions, 15 deletions
diff --git a/source4/scripting/python/samba/provision/sambadns.py b/source4/scripting/python/samba/provision/sambadns.py
index 34bcf72c03..468c86344d 100644
--- a/source4/scripting/python/samba/provision/sambadns.py
+++ b/source4/scripting/python/samba/provision/sambadns.py
@@ -54,19 +54,6 @@ def get_domainguid(samdb, domaindn):
domainguid = str(ndr_unpack(misc.GUID, res[0]["objectGUID"][0]))
return domainguid
-def get_ntdsguid(samdb, domaindn):
- configdn = samdb.get_config_basedn()
-
- res1 = samdb.search(base="OU=Domain Controllers,%s" % domaindn, scope=ldb.SCOPE_ONELEVEL,
- attrs=["dNSHostName"])
-
- res2 = samdb.search(expression="serverReference=%s" % res1[0].dn, base=configdn)
-
- res3 = samdb.search(base="CN=NTDS Settings,%s" % res2[0].dn, scope=ldb.SCOPE_BASE,
- attrs=["objectGUID"])
- ntdsguid = str(ndr_unpack(misc.GUID, res3[0]["objectGUID"][0]))
- return ntdsguid
-
def get_dnsadmins_sid(samdb, domaindn):
res = samdb.search(base="CN=DnsAdmins,CN=Users,%s" % domaindn, scope=ldb.SCOPE_BASE,
attrs=["objectSid"])
@@ -988,7 +975,6 @@ def setup_ad_dns(samdb, secretsdb, domainsid, names, paths, lp, logger, dns_back
dnsadmins_sid = get_dnsadmins_sid(samdb, domaindn)
domainguid = get_domainguid(samdb, domaindn)
- ntdsguid = get_ntdsguid(samdb, domaindn)
# Create CN=System
logger.info("Creating CN=MicrosoftDNS,CN=System,%s" % forestdn)
@@ -1012,7 +998,7 @@ def setup_ad_dns(samdb, secretsdb, domainsid, names, paths, lp, logger, dns_back
logger.info("Populating DomainDnsZones and ForestDnsZones partitions")
fill_dns_data_partitions(samdb, domainsid, site, domaindn, forestdn,
dnsdomain, dnsforest, hostname, hostip, hostip6,
- domainguid, ntdsguid, dnsadmins_sid)
+ domainguid, names.ntdsguid, dnsadmins_sid)
if dns_backend.startswith("BIND9_"):
secretsdb_setup_dns(secretsdb, names,