diff options
author | Andrew Bartlett <abartlet@samba.org> | 2013-09-06 15:46:05 +1200 |
---|---|---|
committer | Stefan Metzmacher <metze@samba.org> | 2013-09-16 19:36:45 +0200 |
commit | 650eca0e061c731614b5fa49756872d11b7b67f0 (patch) | |
tree | c8a3622d43c9b24175ef33672677165fa095ba7a /python/samba/join.py | |
parent | cccc0dee04e2e3aecd82ed4cf887f9e36dd4962d (diff) | |
download | samba-650eca0e061c731614b5fa49756872d11b7b67f0.tar.gz samba-650eca0e061c731614b5fa49756872d11b7b67f0.tar.bz2 samba-650eca0e061c731614b5fa49756872d11b7b67f0.zip |
join.py: Restore support for joining as a subdomain
This set of patches fixes up the errors that were introduced into the partial support
during the past couple of years.
Andrew Bartlett
Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
Diffstat (limited to 'python/samba/join.py')
-rw-r--r-- | python/samba/join.py | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/python/samba/join.py b/python/samba/join.py index 4f2d27343c..b298f88fb8 100644 --- a/python/samba/join.py +++ b/python/samba/join.py @@ -154,6 +154,7 @@ class dc_join(object): ctx.drsuapi = None ctx.managedby = None ctx.subdomain = False + ctx.adminpass = None def del_noerror(ctx, dn, recursive=False): if recursive: @@ -1071,7 +1072,8 @@ class dc_join(object): ctx.nc_list += [ctx.domaindns_zone] if ctx.dns_backend != "NONE": - ctx.full_nc_list += ['DC=DomainDnsZones,%s' % ctx.base_dn] + if not ctx.subdomain: + ctx.full_nc_list += ['DC=DomainDnsZones,%s' % ctx.base_dn] ctx.full_nc_list += ['DC=ForestDnsZones,%s' % ctx.root_dn] ctx.nc_list += ['DC=ForestDnsZones,%s' % ctx.root_dn] @@ -1183,12 +1185,16 @@ def join_DC(server=None, creds=None, lp=None, site=None, netbios_name=None, def join_subdomain(server=None, creds=None, lp=None, site=None, netbios_name=None, targetdir=None, parent_domain=None, dnsdomain=None, - netbios_domain=None, machinepass=None, use_ntvfs=False, + netbios_domain=None, machinepass=None, adminpass=None, use_ntvfs=False, dns_backend=None): """Join as a DC.""" ctx = dc_join(server, creds, lp, site, netbios_name, targetdir, parent_domain, machinepass, use_ntvfs, dns_backend) ctx.subdomain = True + if adminpass is None: + ctx.adminpass = samba.generate_random_password(12, 32) + else: + ctx.adminpass = adminpass ctx.parent_domain_name = ctx.domain_name ctx.domain_name = netbios_domain ctx.realm = dnsdomain |