lib/chkhash.c: is_valid_hash(): Comment meaning of !hash and *

Signed-off-by: Alejandro Colomar <alx@kernel.org>
This commit is contained in:
Alejandro Colomar 2026-01-15 01:24:10 +01:00 committed by Iker Pedrosa
parent bce404a7a8
commit 9a86c515a1

View File

@ -38,12 +38,14 @@ match_regex(const char *pattern, const char *string)
bool
is_valid_hash(const char *hash)
{
// Password temporarily locked
hash = strprefix(hash, "!") ?: hash;
// Passwordless account; discouraged
if (streq(hash, ""))
return true;
// Password permanently locked (and forgotten)
if (streq(hash, "*"))
return true;