]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
upgradehelpers.py: add a comment to update_krbtgt_account_password()
authorStefan Metzmacher <metze@samba.org>
Mon, 21 Feb 2022 14:23:54 +0000 (15:23 +0100)
committerJule Anger <janger@samba.org>
Mon, 7 Mar 2022 10:12:26 +0000 (10:12 +0000)
The backend generates its own random krbtgt password values.

BUG: https://bugzilla.samba.org/show_bug.cgi?id=14984

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
(cherry picked from commit ad0b5561b492dfa28acfc9604b2358bb8b490703)

python/samba/upgradehelpers.py

index ee71b2972bc2579ca56579cbcdc04d0cb02c6dbc..0f4e65fcaedc21d216e6a250a933060153b2d8f1 100644 (file)
@@ -660,9 +660,12 @@ def update_krbtgt_account_password(samdb):
     assert(len(res) == 1)
 
     msg = ldb.Message(res[0].dn)
-    machinepass = samba.generate_random_machine_password(128, 255)
-    mputf16 = machinepass.encode('utf-16-le')
-    msg["clearTextPassword"] = ldb.MessageElement(mputf16,
+    # Note that the machinepass value is ignored
+    # as the backend (password_hash.c) will generate its
+    # own random values for the krbtgt keys
+    krbtgtpass = samba.generate_random_machine_password(128, 255)
+    kputf16 = krbtgtpass.encode('utf-16-le')
+    msg["clearTextPassword"] = ldb.MessageElement(kputf16,
                                                   ldb.FLAG_MOD_REPLACE,
                                                   "clearTextPassword")