From 9154d4dcfc142c0a549993f2e1083eb52a759213 Mon Sep 17 00:00:00 2001 From: Matthias Dieter Wallnöfer Date: Sun, 7 Nov 2010 22:08:19 +0100 Subject: s4:samdb_msg_find_old_and_new_ldb_val - rework - don't crash when no values where specified - return ERR_CONSTRAINT_VIOLATION on malformed messages - only check for flags when we are involved in a LDB modify operation --- source4/dsdb/samdb/ldb_modules/password_hash.c | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) (limited to 'source4/dsdb/samdb') diff --git a/source4/dsdb/samdb/ldb_modules/password_hash.c b/source4/dsdb/samdb/ldb_modules/password_hash.c index b2ce9d4587..e5785f7fb7 100644 --- a/source4/dsdb/samdb/ldb_modules/password_hash.c +++ b/source4/dsdb/samdb/ldb_modules/password_hash.c @@ -1687,7 +1687,9 @@ static int setup_io(struct ph_context *ac, } ret = samdb_msg_find_old_and_new_ldb_val(orig_msg, "userPassword", - &io->n.cleartext_utf8, &io->og.cleartext_utf8); + ac->req->operation, + &io->n.cleartext_utf8, + &io->og.cleartext_utf8); if (ret != LDB_SUCCESS) { ldb_asprintf_errstring(ldb, "setup_io: " @@ -1696,7 +1698,9 @@ static int setup_io(struct ph_context *ac, } ret = samdb_msg_find_old_and_new_ldb_val(orig_msg, "clearTextPassword", - &io->n.cleartext_utf16, &io->og.cleartext_utf16); + ac->req->operation, + &io->n.cleartext_utf16, + &io->og.cleartext_utf16); if (ret != LDB_SUCCESS) { ldb_asprintf_errstring(ldb, "setup_io: " @@ -1718,7 +1722,9 @@ static int setup_io(struct ph_context *ac, a nthash */ ret = samdb_msg_find_old_and_new_ldb_val(orig_msg, "unicodePwd", - "ed_utf16, &old_quoted_utf16); + ac->req->operation, + "ed_utf16, + &old_quoted_utf16); if (ret != LDB_SUCCESS) { ldb_asprintf_errstring(ldb, "setup_io: " @@ -1833,7 +1839,8 @@ static int setup_io(struct ph_context *ac, /* Handles the "dBCSPwd" attribute (LM hash) */ io->n.lm_hash = NULL; io->og.lm_hash = NULL; ret = samdb_msg_find_old_and_new_ldb_val(orig_msg, "dBCSPwd", - &lm_hash, &old_lm_hash); + ac->req->operation, + &lm_hash, &old_lm_hash); if (ret != LDB_SUCCESS) { ldb_asprintf_errstring(ldb, "setup_io: " -- cgit