s4:dsdb/password_hash: only try to handle a hash in the unicodePwd field if it's...
authorStefan Metzmacher <metze@samba.org>
Tue, 11 May 2010 06:32:40 +0000 (08:32 +0200)
committerStefan Metzmacher <metze@samba.org>
Tue, 11 May 2010 06:37:03 +0000 (08:37 +0200)
Sorry, I removed this logic while cleaning up indentation levels...

metze

source4/dsdb/samdb/ldb_modules/password_hash.c

index 0334c6d95e220a89954c4a0d5d31cef21ee43c7c..c40656ef4227a99a9ecf124c1cbd037b1cccd4d2 100644 (file)
@@ -1762,7 +1762,7 @@ static int setup_io(struct ph_context *ac,
                io->n.cleartext_utf16 = quoted_utf16_2;
                io->n.nt_hash = NULL;
 
-       } else {
+       } else if (quoted_utf16) {
                /* We have only the hash available -> so no plaintext here */
                if (!ac->hash_values) {
                        /* refuse the change if someone wants to change
@@ -1821,7 +1821,7 @@ static int setup_io(struct ph_context *ac,
 
                io->og.cleartext_utf16 = old_quoted_utf16_2;
                io->og.nt_hash = NULL;
-       } else {
+       } else if (old_quoted_utf16) {
                /* We have only the hash available -> so no plaintext here */
                if (!ac->hash_values) {
                        /* refuse the change if someone wants to change