#51044 Issue 51027 - Test passwordHistory is not rewritten on a fail attempt
Closed by spichugi. Opened by spichugi.
spichugi/389-ds-base i51027  into  master

Download 51044.patch

Description: Add a test that check that "passwordHistory" attribute
for a user doesn't get updated if a password change fails due to
password repetition.
Add a fixture for the test user and its ACI.

https://pagure.io/389-ds-base/issue/51027

Reviewed by: ?

Test looks good. Is it failing without all these sleep ?

Test looks good. Is it failing without all these sleep ?

Yes, it successfully sets a password even when it's in passwordHistory.

    # Try to change the password 2 more times to see
    # if it rewrites passwordHistory even on a failure attempt
    with pytest.raises(ldap.CONSTRAINT_VIOLATION):
>           user.set('userpassword', 'password2')
E           Failed: DID NOT RAISE <class 'ldap.CONSTRAINT_VIOLATION'>

But it is a known issue for some time (other tests are written in a certain way to honor it). We can improve the passwordHistory processing at some point but I think it is nearly a corner case and I don't see much room for security exploit here.
We can discuss and triage it though :)
I've opened an issue - https://pagure.io/389-ds-base/issue/51046

Thanks for the information. You have my ACK

rebased onto 05f8661762dff56e8f0602bc9d04450bfc89fb1f

Pull-Request has been merged by spichugi

389-ds-base is moving from Pagure to Github. This means that new issues and pull requests
will be accepted only in 389-ds-base's github repository.

This pull request has been cloned to Github as issue and is available here:
- https://github.com/389ds/389-ds-base/issues/4097

If you want to continue to work on the PR, please navigate to the github issue,
download the patch from the attachments and file a new pull request.

Thank you for understanding. We apologize for all inconvenience.

Pull-Request has been closed by spichugi

Metadata