From: Stefan Metzmacher Date: Tue, 31 May 2016 07:39:07 +0000 (+0200) Subject: s4:dsdb/password_hash: leave the current value of pwdLastSet as 0 an add X-Git-Tag: tdb-1.3.10~672 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=5e48dbbf2a5778d850dcbb289400fd99aab172aa;p=thirdparty%2Fsamba.git s4:dsdb/password_hash: leave the current value of pwdLastSet as 0 an add BUG: https://bugzilla.samba.org/show_bug.cgi?id=9654 Signed-off-by: Stefan Metzmacher Reviewed-by: Andrew Bartlett --- diff --git a/source4/dsdb/samdb/ldb_modules/password_hash.c b/source4/dsdb/samdb/ldb_modules/password_hash.c index 72bf537ef66..40bbf496a2f 100644 --- a/source4/dsdb/samdb/ldb_modules/password_hash.c +++ b/source4/dsdb/samdb/ldb_modules/password_hash.c @@ -2317,7 +2317,13 @@ static int setup_io(struct ph_context *ac, io->u.userAccountControl = ldb_msg_find_attr_as_uint(info_msg, "userAccountControl", 0); - io->u.pwdLastSet = samdb_result_nttime(info_msg, "pwdLastSet", 0); + if (info_msg == existing_msg) { + /* + * We only take pwdLastSet from the existing object + * otherwise we leave it as 0. + */ + io->u.pwdLastSet = samdb_result_nttime(info_msg, "pwdLastSet", 0); + } io->u.sAMAccountName = ldb_msg_find_attr_as_string(info_msg, "sAMAccountName", NULL); io->u.user_principal_name = ldb_msg_find_attr_as_string(info_msg,