diff options
author | Andrew Bartlett <abartlet@samba.org> | 2011-08-26 16:07:05 +1000 |
---|---|---|
committer | Andrew Bartlett <abartlet@samba.org> | 2011-09-13 15:37:12 +1000 |
commit | dd9138d9c64cbc6d381ce589eb247a33b8f5e217 (patch) | |
tree | 974ca96b26780aac26c04495355458e3bd76a578 /source4 | |
parent | c271b7142062f833869bb13aed4a873edcd1e445 (diff) | |
download | samba-dd9138d9c64cbc6d381ce589eb247a33b8f5e217.tar.gz samba-dd9138d9c64cbc6d381ce589eb247a33b8f5e217.tar.bz2 samba-dd9138d9c64cbc6d381ce589eb247a33b8f5e217.zip |
s4-join Add a partitions DN when we join a subdomain
Diffstat (limited to 'source4')
-rw-r--r-- | source4/scripting/python/samba/join.py | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/source4/scripting/python/samba/join.py b/source4/scripting/python/samba/join.py index 2967ddf7e7..cf2033481e 100644 --- a/source4/scripting/python/samba/join.py +++ b/source4/scripting/python/samba/join.py @@ -154,6 +154,8 @@ class dc_join(object): ctx.del_noerror(ctx.server_dn, recursive=True) if ctx.topology_dn: ctx.del_noerror(ctx.topology_dn) + if ctx.partition_dn: + ctx.del_noerror(ctx.partition_dn) if res: ctx.new_krbtgt_dn = res[0]["msDS-Krbtgtlink"][0] ctx.del_noerror(ctx.new_krbtgt_dn) @@ -373,6 +375,19 @@ class dc_join(object): rec["invocationId"] = ndr_pack(misc.GUID(str(uuid.uuid4()))) ctx.DsAddEntry(rec) + if ctx.subdomain: + print "Adding %s" % ctx.partition_dn + rec = { + "dn" : ctx.partition_dn, + "objectclass" : "crossRef", + "systemFlags" : str(samba.dsdb.SYSTEM_FLAG_CR_NTDS_NC|samba.dsdb.SYSTEM_FLAG_CR_NTDS_DOMAIN), + "dnsRoot": ctx.dnsdomain, + "nCName" : extended_base_dn, + "nETBIOSName" : ctx.domain_name, + "ntMixedDomain": str(0), + "msDS-Behavior-Version" : str(ctx.behavior_version)} + ctx.DsAddEntry(rec) + # find the GUID of our NTDS DN res = ctx.samdb.search(base=ctx.ntds_dn, scope=ldb.SCOPE_BASE, attrs=["objectGUID"]) ctx.ntds_guid = misc.GUID(ctx.samdb.schema_format_value("objectGUID", res[0]["objectGUID"][0])) @@ -643,6 +658,7 @@ def join_subdomain(server=None, creds=None, lp=None, site=None, netbios_name=Non ctx.domain_name = netbios_domain ctx.realm = dnsdomain ctx.dnsdomain = dnsdomain + ctx.partition_dn = "CN=%s,CN=Partitions,%s" % (ctx.domain_name, ctx.config_dn) ctx.base_dn = samba.dn_from_dns_name(dnsdomain) ctx.domsid = str(security.random_sid()) ctx.acct_dn = None |