mirror of
https://github.com/samba-team/samba.git
synced 2024-12-24 21:34:56 +03:00
samba-tool:domain: use generate_random_machine_password() for machine passwords
BUG: https://bugzilla.samba.org/show_bug.cgi?id=12262 Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Ralph Boehme <slow@samba.org>
This commit is contained in:
parent
b2fac99ac6
commit
f04e09e196
@ -105,7 +105,7 @@ class dc_join(object):
|
|||||||
if machinepass is not None:
|
if machinepass is not None:
|
||||||
ctx.acct_pass = machinepass
|
ctx.acct_pass = machinepass
|
||||||
else:
|
else:
|
||||||
ctx.acct_pass = samba.generate_random_password(32, 40)
|
ctx.acct_pass = samba.generate_random_machine_password(128, 255)
|
||||||
|
|
||||||
ctx.dnsdomain = ctx.samdb.domain_dns_name()
|
ctx.dnsdomain = ctx.samdb.domain_dns_name()
|
||||||
if clone_only:
|
if clone_only:
|
||||||
@ -684,7 +684,7 @@ class dc_join(object):
|
|||||||
pass
|
pass
|
||||||
ctx.net.set_password(account_name=ctx.samname,
|
ctx.net.set_password(account_name=ctx.samname,
|
||||||
domain_name=ctx.domain_name,
|
domain_name=ctx.domain_name,
|
||||||
newpassword=ctx.acct_pass)
|
newpassword=ctx.acct_pass.encode('utf-8'))
|
||||||
|
|
||||||
res = ctx.samdb.search(base=ctx.acct_dn, scope=ldb.SCOPE_BASE,
|
res = ctx.samdb.search(base=ctx.acct_dn, scope=ldb.SCOPE_BASE,
|
||||||
attrs=["msDS-KeyVersionNumber"])
|
attrs=["msDS-KeyVersionNumber"])
|
||||||
|
Loading…
Reference in New Issue
Block a user