Skip to content

Commit bdf93b2

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 <mh+githubvisible@zugschlus.de> Reported-by: "Serge E. Hallyn" <serge@hallyn.com> Signed-off-by: Alejandro Colomar <alx@kernel.org>
1 parent f4777ac commit bdf93b2

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

lib/chkhash.c

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

45+
// Passwordless account; discouraged
46+
if (streq(hash, ""))
47+
return true;
48+
4549
if (streq(hash, "*"))
4650
return true;
4751

0 commit comments

Comments
 (0)