]> git.ipfire.org Git - thirdparty/shadow.git/commit
lib/obscure.c: Introduce obscure_get_range
authorTobias Stoeckmann <tobias@stoeckmann.org>
Fri, 19 Dec 2025 11:36:59 +0000 (11:36 +0000)
committerAlejandro Colomar <foss+github@alejandro-colomar.es>
Sat, 20 Dec 2025 19:22:50 +0000 (20:22 +0100)
commitfa889977190ad89664ef3a50db467d6c3a6878bc
tree413caf48a79542ee5f7a919482c452e8e24b60c4
parentdeb192fe788777d3501ca4d7e5730d2102e28252
lib/obscure.c: Introduce obscure_get_range

Unify the retrieval of PASS_MIN_LEN and PASS_MAX_LEN for output
in passwd and actual checks.

Fixes wrong output for minimum password lengths if no such
restriction is configured: 5 is printed, 0 is in effect.

How to reproduce:

1. Use passwd compiled without PAM support
2. Do not specify PASS_MIN_LEN in login.defs
3. Run passwd as a user and enter your old password, then
   - you will see that 5 characters are expected
   - you can just press enter twice

Signed-off-by: Tobias Stoeckmann <tobias@stoeckmann.org>
lib/obscure.c
lib/prototypes.h
src/passwd.c