From: Douglas Bagnall Date: Sun, 11 Jan 2026 10:17:50 +0000 (+1300) Subject: dsdb:password_hash: policy_hints control makes resets check history X-Git-Tag: tdb-1.4.15~94 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=e1188962aa9cec9ab6cf2f4ddaaf19dce858d2dd;p=thirdparty%2Fsamba.git dsdb:password_hash: policy_hints control makes resets check history BUG: https://bugzilla.samba.org/show_bug.cgi?id=12020 Signed-off-by: Douglas Bagnall Reviewed-by: Gary Lockyer --- diff --git a/source4/dsdb/samdb/ldb_modules/password_hash.c b/source4/dsdb/samdb/ldb_modules/password_hash.c index e256e864978..8c25c859b48 100644 --- a/source4/dsdb/samdb/ldb_modules/password_hash.c +++ b/source4/dsdb/samdb/ldb_modules/password_hash.c @@ -3045,7 +3045,7 @@ static int check_password_restrictions(struct setup_password_fields_io *io, WERR } } - if (io->ac->pwd_reset) { + if (io->ac->pwd_reset && ! io->ac->policy_hints_reset_is_change) { *werror = WERR_OK; return LDB_SUCCESS; } @@ -3181,6 +3181,14 @@ static int check_password_restrictions(struct setup_password_fields_io *io, WERR return ret; } } + if (io->ac->pwd_reset) { + /* + * We would have returned before the password history + * check, but the policy hints OID said no. + */ + *werror = WERR_OK; + return LDB_SUCCESS; + } /* are all password changes disallowed? */ if (io->ac->status->domain_data.pwdProperties & DOMAIN_REFUSE_PASSWORD_CHANGE) {