]> git.ipfire.org Git - thirdparty/shadow.git/commit
lib/obscure.c: Fix PASS_MIN_LEN -1 case
authorTobias Stoeckmann <tobias@stoeckmann.org>
Fri, 19 Dec 2025 11:33:45 +0000 (11:33 +0000)
committerAlejandro Colomar <foss+github@alejandro-colomar.es>
Sat, 20 Dec 2025 19:22:50 +0000 (20:22 +0100)
commitdeb192fe788777d3501ca4d7e5730d2102e28252
tree49bb8e92a02beb7eb77fcc634a187f6a5566c0f4
parent7e34e2d06abe00d289703f31ca427e03ae7eaa0e
lib/obscure.c: Fix PASS_MIN_LEN -1 case

The getdef_num implementation allows -1 to be specified in login.defs.
In general, -1 should be treated the same way as "not specified". In
this case, casting -1 to size_t leads to every password being "too
short."

Reviewed-by: Alejandro Colomar <alx@kernel.org>
Signed-off-by: Tobias Stoeckmann <tobias@stoeckmann.org>
lib/obscure.c