Revert "s4: Let the "setpassword" script finally use the "samdb_set_password" routine"
[ira/wip.git] / source4 / scripting / python / samba / samdb.py
index 3f4252b36af3efd5030782e4feb03fcbfd61ac98..a58d6c5b12473ba32126a38fafda460d1ac22110 100644 (file)
@@ -161,14 +161,14 @@ pwdLastSet: 0
             assert(len(res) == 1)
             user_dn = res[0].dn
 
-            mod = ldb.Message()
-            mod.dn = user_dn
-
-            glue.samdb_set_password(samdb=self, user_dn=str(user_dn),
-                        dom_dn=self.domain_dn(), mod=mod, new_password=password,
-                        user_change=False)
+            setpw = """
+dn: %s
+changetype: modify
+replace: userPassword
+userPassword:: %s
+""" % (user_dn, base64.b64encode(password))
 
-            self.modify(mod)
+            self.modify_ldif(setpw)
 
             if force_password_change_at_next_login:
                 self.force_password_change_at_next_login(user_dn)