Bug 21976

Summary: koha-reset-passwd does not deal with password restrictions
Product: Koha Reporter: Jonathan Druart <jonathan.druart>
Component: Command-line UtilitiesAssignee: Tomás Cohen Arazi (tcohen) <tomascohen>
Status: Patch doesn't apply --- QA Contact: Testopia <testopia>
Severity: normal    
Priority: P5 - low CC: robin, tomascohen, wizzyrea
Version: unspecified   
Hardware: All   
OS: All   
See Also: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=23816
Change sponsored?: --- Patch complexity: ---
Documentation contact: Documentation submission:
Text to go in the release notes:
Version(s) released in:
Circulation function:
Bug Depends on: 17746, 18298    
Bug Blocks:    
Attachments: Bug 21976: Make koha-reset-passwd respect restrictions

Description Jonathan Druart 2018-12-07 14:37:53 UTC
Like minPasswordLength and RequireStrongPassword
Comment 1 Jonathan Druart 2018-12-07 15:34:58 UTC
Must it call Koha::AuthUtils::generate_password? See the discussion on bug 17746.
Comment 2 Tomás Cohen Arazi (tcohen) 2019-02-05 17:09:24 UTC

*** This bug has been marked as a duplicate of bug 17746 ***
Comment 3 Tomás Cohen Arazi (tcohen) 2019-02-05 17:10:56 UTC
I think this one should remain open, and probably be an enhancement on top of bug 17746. Sorry for the confusion.
Comment 4 Tomás Cohen Arazi (tcohen) 2019-02-05 17:31:43 UTC
I wrote a patch for this, but then also noticed the 12-digit password generated by pwgen 12 will probably always pass.
Comment 5 Tomás Cohen Arazi (tcohen) 2019-02-05 17:32:12 UTC
Created attachment 84799 [details] [review]
Bug 21976: Make koha-reset-passwd respect restrictions

This patch makes the set_password.pl script default to respect the
restrictions, and adds a --skip_validation parameter to it.

koha-reset-passwd is adapted so it also accepts this parameter. The
result is the default behaviour respects the restrictions, and they can
be skipped.

To test:
- Try with and without the option switch
- Notice the randomly generated password is always strongest than what
we enforce.
- Sign off
Comment 6 Liz Rea 2019-03-26 00:06:45 UTC
Hi,

This patch fails to apply with 

Auto-merging misc/admin/set_password.pl
Auto-merging debian/scripts/koha-reset-passwd
CONFLICT (content): Merge conflict in debian/scripts/koha-reset-passwd

Sorry :(

Cheers,
Liz