mirror of
https://github.com/samba-team/samba.git
synced 2025-01-12 09:18:10 +03:00
s4:python/samba/join.py: add optional 'machinepass' parameter to class dc_join
metze
This commit is contained in:
parent
f8fbc4163b
commit
948f091a22
@ -48,7 +48,8 @@ class dc_join(object):
|
||||
'''perform a DC join'''
|
||||
|
||||
def __init__(ctx, server=None, creds=None, lp=None, site=None,
|
||||
netbios_name=None, targetdir=None, domain=None):
|
||||
netbios_name=None, targetdir=None, domain=None,
|
||||
machinepass=None):
|
||||
ctx.creds = creds
|
||||
ctx.lp = lp
|
||||
ctx.site = site
|
||||
@ -90,7 +91,10 @@ class dc_join(object):
|
||||
ctx.dc_dnsHostName = ctx.get_dnsHostName()
|
||||
ctx.behavior_version = ctx.get_behavior_version()
|
||||
|
||||
ctx.acct_pass = samba.generate_random_password(32, 40)
|
||||
if machinepass is not None:
|
||||
ctx.acct_pass = machinepass
|
||||
else:
|
||||
ctx.acct_pass = samba.generate_random_password(32, 40)
|
||||
|
||||
# work out the DNs of all the objects we will be adding
|
||||
ctx.server_dn = "CN=%s,CN=Servers,CN=%s,CN=Sites,%s" % (ctx.myname, ctx.site, ctx.config_dn)
|
||||
|
Loading…
Reference in New Issue
Block a user