su: Allow disabled passwords

This commit is contained in:
apio 2023-11-22 21:29:21 +01:00
parent 1005305d5a
commit efeab5699e
Signed by: apio
GPG Key ID: B8A7D06E42258954

View File

@ -148,6 +148,12 @@ Result<int> luna_main(int argc, char** argv)
{
signal(SIGTTOU, SIG_IGN);
if (!strcmp(entry->pw_passwd, "!"))
{
fprintf(stderr, "%s: %s's password is disabled!\n", argv[0], entry->pw_name);
return 1;
}
char* pass = getpass();
if (!pass) return 1;