Accept /usr/sbin/nologin as an alternate to /sbin/nologin

Thanks: Marc Haber
This commit is contained in:
Chris Hofstaedtler
2025-03-28 12:12:55 +01:00
parent 302d4ef809
commit de176e27ed
2 changed files with 35 additions and 0 deletions
@@ -0,0 +1,34 @@
From: Chris Hofstaedtler <zeha@debian.org>
Date: Fri, 28 Mar 2025 12:12:13 +0100
Subject: Accept /usr/sbin/nologin as an alternate to /sbin/nologin
Noticed by adduser's autopkgtests, thanks: Marc Haber
---
src/useradd.c | 1 +
src/usermod.c | 1 +
2 files changed, 2 insertions(+)
diff --git a/src/useradd.c b/src/useradd.c
index ba0eb50..f654dd9 100644
--- a/src/useradd.c
+++ b/src/useradd.c
@@ -1419,6 +1419,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 3e9e046..bfc7738 100644
--- a/src/usermod.c
+++ b/src/usermod.c
@@ -1168,6 +1168,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)) {
+1
View File
@@ -16,3 +16,4 @@ upstream/src-chfn.c-Use-stpsep-instead-of-its-pattern.patch
upstream/src-chfn.c-Add-local-variable-to-refer-to-the-separated-f.patch
upstream/src-chfn.c-copy_field-Rename-local-variable.patch
upstream/lib-getdate.y-Ignore-time-zone-information-and-use-UTC.patch
Accept-usr-sbin-nologin-as-an-alternate-to-sbin-nologin.patch