Skip to content

Commit 12cc0aa

Browse files
lib/chkhash.c: is_valid_hash(): Accept an empty hash
It represents a passwordless account. That is discouraged, but accepted. Link: <https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1124835> Reported-by: Marc 'Zugschlus' Haber <[email protected]> Reported-by: "Serge E. Hallyn" <[email protected]> Signed-off-by: Alejandro Colomar <[email protected]>
1 parent f4777ac commit 12cc0aa

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

lib/chkhash.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,9 @@ is_valid_hash(const char *hash)
4242
{
4343
hash = strprefix(hash, "!") ?: hash;
4444

45+
if (streq(hash, ""))
46+
return true; // Passwordless account; discouraged
47+
4548
if (streq(hash, "*"))
4649
return true;
4750

0 commit comments

Comments
 (0)