s4:"samdb_set_password" - remove delete instructions
authorMatthias Dieter Wallnöfer <mwallnoefer@yahoo.de>
Thu, 17 Dec 2009 18:41:11 +0000 (19:41 +0100)
committerMatthias Dieter Wallnöfer <mwallnoefer@yahoo.de>
Thu, 17 Dec 2009 19:00:19 +0000 (20:00 +0100)
They won't work when the LDB change is done using "samdb_replace"
(consider "samr_password.c" functions).

I think this has been a relict which has been useful before the "password_hash"
module existed. Basically it itself does now the updates.

source4/dsdb/common/util.c

index 9de41cd6ee4d8487c77d9f550e59fdf122abb1b0..8ba734c15999a9b8482939dc63631a2d56b76205 100644 (file)
@@ -1863,20 +1863,15 @@ NTSTATUS samdb_set_password(struct ldb_context *ctx, TALLOC_CTX *mem_ctx,
                 * hashes */
                CHECK_RET(ldb_msg_add_value(mod, "clearTextPassword", new_password, NULL));
        } else {
-               /* We don't have the cleartext, so delete the old one
-                * and set what we have of the hashes */
-               CHECK_RET(samdb_msg_add_delete(ctx, mem_ctx, mod, "clearTextPassword"));
+               /* we don't have the cleartext, so set what we have of the
+                * hashes */
 
                if (lmNewHash) {
                        CHECK_RET(samdb_msg_add_hash(ctx, mem_ctx, mod, "dBCSPwd", lmNewHash));
-               } else {
-                       CHECK_RET(samdb_msg_add_delete(ctx, mem_ctx, mod, "dBCSPwd"));
                }
 
                if (ntNewHash) {
                        CHECK_RET(samdb_msg_add_hash(ctx, mem_ctx, mod, "unicodePwd", ntNewHash));
-               } else {
-                       CHECK_RET(samdb_msg_add_delete(ctx, mem_ctx, mod, "unicodePwd"));
                }
        }