samba-tool:provision: use generate_random_machine_password() for machine passwords
authorStefan Metzmacher <metze@samba.org>
Tue, 23 Aug 2016 10:40:24 +0000 (12:40 +0200)
committerRalph Boehme <slow@samba.org>
Tue, 21 Feb 2017 15:09:22 +0000 (16:09 +0100)
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>
python/samba/provision/__init__.py
python/samba/upgradehelpers.py

index ad269aa1463cdff088306713e3ec0428bc956556..81bbb0c1d26c8d0db3500da5fd78be4587fd57d3 100644 (file)
@@ -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)
 
index 9b2c1c233aaa004897f9e5139baa1715ab0523b3..99ffe28c9b54b6f4bd2b2566bf9e96b00ef9fe5d 100644 (file)
@@ -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,