From efeab5699e3c51723729e1c38e4b3945ca9e4bc4 Mon Sep 17 00:00:00 2001 From: apio Date: Wed, 22 Nov 2023 21:29:21 +0100 Subject: [PATCH] su: Allow disabled passwords --- apps/su.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/apps/su.cpp b/apps/su.cpp index 80b1a8a8..a2d9aa56 100644 --- a/apps/su.cpp +++ b/apps/su.cpp @@ -148,6 +148,12 @@ Result 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;