From 11698a287e2ca1e937a465225af033e269749eb3 Mon Sep 17 00:00:00 2001 From: Andrew Bartlett Date: Thu, 11 Aug 2011 15:50:54 +1000 Subject: s4-dsdb ensure we honour the hash_values control, even for really odd hashes --- source4/dsdb/samdb/ldb_modules/password_hash.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/source4/dsdb/samdb/ldb_modules/password_hash.c b/source4/dsdb/samdb/ldb_modules/password_hash.c index 470a2b05a3..02e68cd919 100644 --- a/source4/dsdb/samdb/ldb_modules/password_hash.c +++ b/source4/dsdb/samdb/ldb_modules/password_hash.c @@ -2195,7 +2195,8 @@ static int setup_io(struct ph_context *ac, } /* Checks and converts the actual "unicodePwd" attribute */ - if (quoted_utf16 && + if (!ac->hash_values && + quoted_utf16 && quoted_utf16->length >= 4 && quoted_utf16->data[0] == '"' && quoted_utf16->data[1] == 0 && @@ -2251,7 +2252,8 @@ static int setup_io(struct ph_context *ac, } /* Checks and converts the previous "unicodePwd" attribute */ - if (old_quoted_utf16 && + if (!ac->hash_values && + old_quoted_utf16 && old_quoted_utf16->length >= 4 && old_quoted_utf16->data[0] == '"' && old_quoted_utf16->data[1] == 0 && -- cgit