diff options
author | Stefan Metzmacher <metze@samba.org> | 2013-01-23 08:56:00 +0100 |
---|---|---|
committer | Andrew Bartlett <abartlet@samba.org> | 2013-01-27 20:14:20 +1100 |
commit | b54b58e75d3c1a3080e81c61156b75ef1d241b71 (patch) | |
tree | 15e5d304a1bbc0061b38a5604e0b949cd6e756e9 /source4/scripting/python | |
parent | f51248339ae7ba9843e477493a69b0c4f647935a (diff) | |
download | samba-b54b58e75d3c1a3080e81c61156b75ef1d241b71.tar.gz samba-b54b58e75d3c1a3080e81c61156b75ef1d241b71.tar.bz2 samba-b54b58e75d3c1a3080e81c61156b75ef1d241b71.zip |
provision: setup names.dns{forest,domain}dn
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Diffstat (limited to 'source4/scripting/python')
-rw-r--r-- | source4/scripting/python/samba/provision/__init__.py | 23 |
1 files changed, 22 insertions, 1 deletions
diff --git a/source4/scripting/python/samba/provision/__init__.py b/source4/scripting/python/samba/provision/__init__.py index 4bfbcd9a09..75b083731c 100644 --- a/source4/scripting/python/samba/provision/__init__.py +++ b/source4/scripting/python/samba/provision/__init__.py @@ -135,10 +135,13 @@ class ProvisionPaths(object): class ProvisionNames(object): def __init__(self): + self.ncs = None self.rootdn = None self.domaindn = None self.configdn = None self.schemadn = None + self.dnsforestdn = None + self.dnsdomaindn = None self.ldapmanagerdn = None self.dnsdomain = None self.realm = None @@ -184,7 +187,8 @@ def find_provision_key_parameters(samdb, secretsdb, idmapdb, paths, smbconf, current = samdb.search(expression="(objectClass=*)", base="", scope=ldb.SCOPE_BASE, attrs=["defaultNamingContext", "schemaNamingContext", - "configurationNamingContext","rootDomainNamingContext"]) + "configurationNamingContext","rootDomainNamingContext", + "namingContexts"]) names.configdn = current[0]["configurationNamingContext"] configdn = str(names.configdn) @@ -198,6 +202,23 @@ def find_provision_key_parameters(samdb, secretsdb, idmapdb, paths, smbconf, names.domaindn=current[0]["defaultNamingContext"] names.rootdn=current[0]["rootDomainNamingContext"] + names.ncs=current[0]["namingContexts"] + names.dnsforestdn = None + names.dnsdomaindn = None + + for i in range(0, len(names.ncs)): + nc = names.ncs[i] + + dnsforestdn = "DC=ForestDnsZones,%s" % (str(names.rootdn)) + if nc == dnsforestdn: + names.dnsforestdn = dnsforestdn + continue + + dnsdomaindn = "DC=DomainDnsZones,%s" % (str(names.domaindn)) + if nc == dnsdomaindn: + names.dnsdomaindn = dnsdomaindn + continue + # default site name res3 = samdb.search(expression="(objectClass=site)", base="CN=Sites," + configdn, scope=ldb.SCOPE_ONELEVEL, attrs=["cn"]) |