]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
dsdb:password_hash: policy_hints control makes resets check history
authorDouglas Bagnall <douglas.bagnall@catalyst.net.nz>
Sun, 11 Jan 2026 10:17:50 +0000 (23:17 +1300)
committerDouglas Bagnall <dbagnall@samba.org>
Thu, 15 Jan 2026 01:48:37 +0000 (01:48 +0000)
BUG: https://bugzilla.samba.org/show_bug.cgi?id=12020

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Gary Lockyer <gary@catalyst.net.nz>
source4/dsdb/samdb/ldb_modules/password_hash.c

index e256e8649786f4c3e1b956fd04b7a171818cdb86..8c25c859b4894c7cc19bb4b91712823afde8cc95 100644 (file)
@@ -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) {