This is widely accepted as an invalid hash, to remove password access
for an account (that is, no passwords will match the "hash").
Fixes: c44f1e096a19 (2025-07-20; "chpasswd: Check hash before write when using -e")
Closes: <https://github.com/shadow-maint/shadow/issues/1483>
Closes: <https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1124835>
Reported-by: Chris Hofstaedtler <zeha@debian.org>
Reviewed-by: Chris Hofstaedtler <zeha@debian.org>
Cc: vinz <mmpx09@protonmail.com>
Signed-off-by: Alejandro Colomar <alx@kernel.org>
#include <stddef.h>
#include <string.h>
+#include "string/strcmp/streq.h"
#include "string/strcmp/strprefix.h"
{
hash = strprefix(hash, "!") ?: hash;
+ if (streq(hash, "*"))
+ return true;
+
// Minimum hash length
if (strlen(hash) < 13)
return false;