summaryrefslogtreecommitdiff
path: root/python
diff options
context:
space:
mode:
authorStefan Metzmacher <metze@samba.org>2016-08-23 12:40:24 +0200
committerRalph Boehme <slow@samba.org>2017-02-21 16:09:22 +0100
commitea57a204a1f6b4999e5347c1edb5753bed933fba (patch)
treec48cac1edabb730478bd304bad3ad28e53391618 /python
parentf04e09e1968c40483b8dc2f92b9c15bce0b0b55a (diff)
downloadsamba-ea57a204a1f6b4999e5347c1edb5753bed933fba.tar.gz
samba-tool:provision: 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>
Diffstat (limited to 'python')
-rw-r--r--python/samba/provision/__init__.py4
-rw-r--r--python/samba/upgradehelpers.py4
2 files changed, 4 insertions, 4 deletions
diff --git a/python/samba/provision/__init__.py b/python/samba/provision/__init__.py
index ad269aa1463..81bbb0c1d26 100644
--- a/python/samba/provision/__init__.py
+++ b/python/samba/provision/__init__.py
@@ -1768,9 +1768,9 @@ def provision_fill(samdb, secrets_ldb, logger, names, paths,
invocationid = str(uuid.uuid4())
if krbtgtpass is None:
- krbtgtpass = samba.generate_random_password(128, 255)
+ krbtgtpass = samba.generate_random_machine_password(128, 255)
if machinepass is None:
- machinepass = samba.generate_random_password(128, 255)
+ machinepass = samba.generate_random_machine_password(128, 255)
if dnspass is None:
dnspass = samba.generate_random_password(128, 255)
diff --git a/python/samba/upgradehelpers.py b/python/samba/upgradehelpers.py
index 9b2c1c233aa..99ffe28c9b5 100644
--- a/python/samba/upgradehelpers.py
+++ b/python/samba/upgradehelpers.py
@@ -573,7 +573,7 @@ def update_machine_account_password(samdb, secrets_ldb, names):
assert(len(res) == 1)
msg = ldb.Message(res[0].dn)
- machinepass = samba.generate_random_password(128, 255)
+ machinepass = samba.generate_random_machine_password(128, 255)
mputf16 = machinepass.encode('utf-16-le')
msg["clearTextPassword"] = ldb.MessageElement(mputf16,
ldb.FLAG_MOD_REPLACE,
@@ -648,7 +648,7 @@ def update_krbtgt_account_password(samdb, names):
assert(len(res) == 1)
msg = ldb.Message(res[0].dn)
- machinepass = samba.generate_random_password(128, 255)
+ machinepass = samba.generate_random_machine_password(128, 255)
mputf16 = machinepass.encode('utf-16-le')
msg["clearTextPassword"] = ldb.MessageElement(mputf16,
ldb.FLAG_MOD_REPLACE,