diff options
author | Matthias Dieter Wallnöfer <mdw@samba.org> | 2010-11-07 22:08:19 +0100 |
---|---|---|
committer | Matthias Dieter Wallnöfer <mdw@samba.org> | 2010-11-08 11:27:03 +0000 |
commit | 9154d4dcfc142c0a549993f2e1083eb52a759213 (patch) | |
tree | 18fb89989022c1954ca22b5fe4137ccd60ef7c74 /source4/dsdb/samdb | |
parent | 6041ef7442fda2f96c416d333f1dfc6dabd0d252 (diff) | |
download | samba-9154d4dcfc142c0a549993f2e1083eb52a759213.tar.gz samba-9154d4dcfc142c0a549993f2e1083eb52a759213.tar.bz2 samba-9154d4dcfc142c0a549993f2e1083eb52a759213.zip |
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
Diffstat (limited to 'source4/dsdb/samdb')
-rw-r--r-- | source4/dsdb/samdb/ldb_modules/password_hash.c | 15 |
1 files changed, 11 insertions, 4 deletions
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: " |