From: Chris Hofstaedtler Date: Fri, 28 Mar 2025 11:12:13 +0000 (+0100) Subject: Accept /usr/sbin/nologin as an alternate to /sbin/nologin X-Git-Tag: 4.18.0-rc1~110 X-Git-Url: http://git.ipfire.org/gitweb/gitweb.cgi?a=commitdiff_plain;h=b4beda846c4bd2c54d2b246ec18948acc47502c1;p=thirdparty%2Fshadow.git Accept /usr/sbin/nologin as an alternate to /sbin/nologin Relevant on fully-usr-merged distributions. Signed-off-by: Chris Hofstaedtler Reported-by: Marc Haber Reviewed-by: Alejandro Colomar --- diff --git a/src/useradd.c b/src/useradd.c index 6e744b042..84647ee11 100644 --- a/src/useradd.c +++ b/src/useradd.c @@ -1377,6 +1377,7 @@ static void process_flags (int argc, char **argv) if (!streq(optarg, "") && '*' != optarg[0] && !streq(optarg, "/sbin/nologin") + && !streq(optarg, "/usr/sbin/nologin") && ( stat(optarg, &st) != 0 || S_ISDIR(st.st_mode) || access(optarg, X_OK) != 0)) { diff --git a/src/usermod.c b/src/usermod.c index 22113daaa..fc29729a9 100644 --- a/src/usermod.c +++ b/src/usermod.c @@ -1176,6 +1176,7 @@ process_flags(int argc, char **argv) if (!streq(optarg, "") && '*' != optarg[0] && !streq(optarg, "/sbin/nologin") + && !streq(optarg, "/usr/sbin/nologin") && ( stat(optarg, &st) != 0 || S_ISDIR(st.st_mode) || access(optarg, X_OK) != 0)) {