summaryrefslogtreecommitdiff
path: root/test/TEST-21-SYSUSERS
diff options
context:
space:
mode:
authorMichael Biebl <biebl@debian.org>2019-07-18 01:24:00 +0200
committerMichael Biebl <biebl@debian.org>2019-07-18 12:46:35 +0200
commit6db904625d413739c480ddbe7667d3f40acc4ae0 (patch)
tree36462ca0acf0bf85407d860c55e49b032a5495a7 /test/TEST-21-SYSUSERS
parentea582a0f1b052330a45b5d7bbc9fb860d1c0d98b (diff)
downloadsystemd-6db904625d413739c480ddbe7667d3f40acc4ae0.tar.gz
meson: make nologin path build time configurable
Some distros install nologin as /usr/sbin/nologin, others as /sbin/nologin. Since we can't really on merged-usr everywhere (where the path wouldn't matter), make the path build time configurable via -Dnologin-path=. Closes #13028
Diffstat (limited to 'test/TEST-21-SYSUSERS')
-rw-r--r--test/TEST-21-SYSUSERS/test-1.expected-passwd2
-rw-r--r--test/TEST-21-SYSUSERS/test-10.expected-passwd4
-rw-r--r--test/TEST-21-SYSUSERS/test-11.expected-passwd2
-rw-r--r--test/TEST-21-SYSUSERS/test-12.expected-passwd2
-rw-r--r--test/TEST-21-SYSUSERS/test-2.expected-passwd2
-rw-r--r--test/TEST-21-SYSUSERS/test-3.expected-passwd8
-rw-r--r--test/TEST-21-SYSUSERS/test-4.expected-passwd4
-rw-r--r--test/TEST-21-SYSUSERS/test-5.expected-passwd34
-rw-r--r--test/TEST-21-SYSUSERS/test-6.expected-passwd2
-rw-r--r--test/TEST-21-SYSUSERS/test-7.expected-passwd10
-rw-r--r--test/TEST-21-SYSUSERS/test-8.expected-passwd2
-rw-r--r--test/TEST-21-SYSUSERS/test-9.expected-passwd4
-rwxr-xr-xtest/TEST-21-SYSUSERS/test.sh9
13 files changed, 46 insertions, 39 deletions
diff --git a/test/TEST-21-SYSUSERS/test-1.expected-passwd b/test/TEST-21-SYSUSERS/test-1.expected-passwd
index 8d0bfff319..f59303b5c9 100644
--- a/test/TEST-21-SYSUSERS/test-1.expected-passwd
+++ b/test/TEST-21-SYSUSERS/test-1.expected-passwd
@@ -1 +1 @@
-u1:x:222:222::/:/sbin/nologin
+u1:x:222:222::/:NOLOGIN
diff --git a/test/TEST-21-SYSUSERS/test-10.expected-passwd b/test/TEST-21-SYSUSERS/test-10.expected-passwd
index 222334bf70..ca2d764ea0 100644
--- a/test/TEST-21-SYSUSERS/test-10.expected-passwd
+++ b/test/TEST-21-SYSUSERS/test-10.expected-passwd
@@ -1,2 +1,2 @@
-u1:x:300:300::/:/sbin/nologin
-u2:x:SYSTEM_UID_MAX:SYSTEM_UID_MAX::/:/sbin/nologin
+u1:x:300:300::/:NOLOGIN
+u2:x:SYSTEM_UID_MAX:SYSTEM_UID_MAX::/:NOLOGIN
diff --git a/test/TEST-21-SYSUSERS/test-11.expected-passwd b/test/TEST-21-SYSUSERS/test-11.expected-passwd
index 3f9ab3901f..737e43bf19 100644
--- a/test/TEST-21-SYSUSERS/test-11.expected-passwd
+++ b/test/TEST-21-SYSUSERS/test-11.expected-passwd
@@ -2,5 +2,5 @@ root:x:0:0:root:/root:/bin/bash
systemd-network:x:492:492:Systemd Network Management:/:/usr/sbin/nologin
systemd-resolve:x:491:491:Systemd Resolver:/:/usr/sbin/nologin
systemd-timesync:x:493:493:Systemd Time Synchronization:/:/usr/sbin/nologin
-u1:x:222:222::/:/sbin/nologin
+u1:x:222:222::/:NOLOGIN
+::::::
diff --git a/test/TEST-21-SYSUSERS/test-12.expected-passwd b/test/TEST-21-SYSUSERS/test-12.expected-passwd
index 75fe9b420d..f076f3d047 100644
--- a/test/TEST-21-SYSUSERS/test-12.expected-passwd
+++ b/test/TEST-21-SYSUSERS/test-12.expected-passwd
@@ -1,2 +1,2 @@
root:x:0:0:root:/root:/bin/bash
-systemd-coredump:x:1:1:systemd Core Dumper:/:/sbin/nologin
+systemd-coredump:x:1:1:systemd Core Dumper:/:NOLOGIN
diff --git a/test/TEST-21-SYSUSERS/test-2.expected-passwd b/test/TEST-21-SYSUSERS/test-2.expected-passwd
index 9eeee5d387..af8068813b 100644
--- a/test/TEST-21-SYSUSERS/test-2.expected-passwd
+++ b/test/TEST-21-SYSUSERS/test-2.expected-passwd
@@ -1,4 +1,4 @@
-u1:x:SYSTEM_UID_MAX:SYSTEM_UID_MAX:some gecos:/random/dir:/sbin/nologin
+u1:x:SYSTEM_UID_MAX:SYSTEM_UID_MAX:some gecos:/random/dir:NOLOGIN
u2:x:777:777:some gecos:/random/dir:/bin/zsh
u3:x:778:778::/random/dir2:/bin/bash
u4:x:779:779::/:/bin/csh
diff --git a/test/TEST-21-SYSUSERS/test-3.expected-passwd b/test/TEST-21-SYSUSERS/test-3.expected-passwd
index a86954f8b3..946303f9ab 100644
--- a/test/TEST-21-SYSUSERS/test-3.expected-passwd
+++ b/test/TEST-21-SYSUSERS/test-3.expected-passwd
@@ -1,4 +1,4 @@
-foo:x:301:301::/:/sbin/nologin
-aaa:x:303:302::/:/sbin/nologin
-bbb:x:304:302::/:/sbin/nologin
-ccc:x:305:305::/:/sbin/nologin
+foo:x:301:301::/:NOLOGIN
+aaa:x:303:302::/:NOLOGIN
+bbb:x:304:302::/:NOLOGIN
+ccc:x:305:305::/:NOLOGIN
diff --git a/test/TEST-21-SYSUSERS/test-4.expected-passwd b/test/TEST-21-SYSUSERS/test-4.expected-passwd
index e0370a4023..99d1048d79 100644
--- a/test/TEST-21-SYSUSERS/test-4.expected-passwd
+++ b/test/TEST-21-SYSUSERS/test-4.expected-passwd
@@ -1,2 +1,2 @@
-yyy:x:311:310::/:/sbin/nologin
-xxx:x:312:310::/:/sbin/nologin
+yyy:x:311:310::/:NOLOGIN
+xxx:x:312:310::/:NOLOGIN
diff --git a/test/TEST-21-SYSUSERS/test-5.expected-passwd b/test/TEST-21-SYSUSERS/test-5.expected-passwd
index 116b126129..a83d566b28 100644
--- a/test/TEST-21-SYSUSERS/test-5.expected-passwd
+++ b/test/TEST-21-SYSUSERS/test-5.expected-passwd
@@ -1,18 +1,18 @@
root:x:0:0::/root:/bin/sh
-daemon:x:1:1::/usr/sbin:/sbin/nologin
-bin:x:2:2::/bin:/sbin/nologin
-sys:x:3:3::/dev:/sbin/nologin
-sync:x:4:65534::/bin:/sbin/nologin
-games:x:5:60::/usr/games:/sbin/nologin
-man:x:6:12::/var/cache/man:/sbin/nologin
-lp:x:7:7::/var/spool/lpd:/sbin/nologin
-mail:x:8:8::/var/mail:/sbin/nologin
-news:x:9:9::/var/spool/news:/sbin/nologin
-uucp:x:10:10::/var/spool/uucp:/sbin/nologin
-proxy:x:13:13::/bin:/sbin/nologin
-www-data:x:33:33::/var/www:/sbin/nologin
-backup:x:34:34::/var/backups:/sbin/nologin
-list:x:38:38::/var/list:/sbin/nologin
-irc:x:39:39::/var/run/ircd:/sbin/nologin
-gnats:x:41:41::/var/lib/gnats:/sbin/nologin
-nobody:x:65534:65534::/nonexistent:/sbin/nologin
+daemon:x:1:1::/usr/sbin:NOLOGIN
+bin:x:2:2::/bin:NOLOGIN
+sys:x:3:3::/dev:NOLOGIN
+sync:x:4:65534::/bin:NOLOGIN
+games:x:5:60::/usr/games:NOLOGIN
+man:x:6:12::/var/cache/man:NOLOGIN
+lp:x:7:7::/var/spool/lpd:NOLOGIN
+mail:x:8:8::/var/mail:NOLOGIN
+news:x:9:9::/var/spool/news:NOLOGIN
+uucp:x:10:10::/var/spool/uucp:NOLOGIN
+proxy:x:13:13::/bin:NOLOGIN
+www-data:x:33:33::/var/www:NOLOGIN
+backup:x:34:34::/var/backups:NOLOGIN
+list:x:38:38::/var/list:NOLOGIN
+irc:x:39:39::/var/run/ircd:NOLOGIN
+gnats:x:41:41::/var/lib/gnats:NOLOGIN
+nobody:x:65534:65534::/nonexistent:NOLOGIN
diff --git a/test/TEST-21-SYSUSERS/test-6.expected-passwd b/test/TEST-21-SYSUSERS/test-6.expected-passwd
index 5af9d1142d..ba55a13e18 100644
--- a/test/TEST-21-SYSUSERS/test-6.expected-passwd
+++ b/test/TEST-21-SYSUSERS/test-6.expected-passwd
@@ -1 +1 @@
-u1:x:SYSTEM_UID_MAX:SYSTEM_UID_MAX::/:/sbin/nologin
+u1:x:SYSTEM_UID_MAX:SYSTEM_UID_MAX::/:NOLOGIN
diff --git a/test/TEST-21-SYSUSERS/test-7.expected-passwd b/test/TEST-21-SYSUSERS/test-7.expected-passwd
index 79668c0654..0c5d370fd7 100644
--- a/test/TEST-21-SYSUSERS/test-7.expected-passwd
+++ b/test/TEST-21-SYSUSERS/test-7.expected-passwd
@@ -1,5 +1,5 @@
-bin:x:1:1::/:/sbin/nologin
-daemon:x:2:2::/:/sbin/nologin
-mail:x:8:12::/var/spool/mail:/sbin/nologin
-ftp:x:14:11::/srv/ftp:/sbin/nologin
-http:x:33:33::/srv/http:/sbin/nologin
+bin:x:1:1::/:NOLOGIN
+daemon:x:2:2::/:NOLOGIN
+mail:x:8:12::/var/spool/mail:NOLOGIN
+ftp:x:14:11::/srv/ftp:NOLOGIN
+http:x:33:33::/srv/http:NOLOGIN
diff --git a/test/TEST-21-SYSUSERS/test-8.expected-passwd b/test/TEST-21-SYSUSERS/test-8.expected-passwd
index 727b8197ef..23e99f0513 100644
--- a/test/TEST-21-SYSUSERS/test-8.expected-passwd
+++ b/test/TEST-21-SYSUSERS/test-8.expected-passwd
@@ -1 +1 @@
-username:x:SYSTEM_UID_MAX:300::/:/sbin/nologin
+username:x:SYSTEM_UID_MAX:300::/:NOLOGIN
diff --git a/test/TEST-21-SYSUSERS/test-9.expected-passwd b/test/TEST-21-SYSUSERS/test-9.expected-passwd
index a23260f56e..0bffbcd9c7 100644
--- a/test/TEST-21-SYSUSERS/test-9.expected-passwd
+++ b/test/TEST-21-SYSUSERS/test-9.expected-passwd
@@ -1,2 +1,2 @@
-user1:x:300:300::/:/sbin/nologin
-user2:x:SYSTEM_UID_MAX:300::/:/sbin/nologin
+user1:x:300:300::/:NOLOGIN
+user2:x:SYSTEM_UID_MAX:300::/:NOLOGIN
diff --git a/test/TEST-21-SYSUSERS/test.sh b/test/TEST-21-SYSUSERS/test.sh
index 9f64e030b5..a1a2e62ab1 100755
--- a/test/TEST-21-SYSUSERS/test.sh
+++ b/test/TEST-21-SYSUSERS/test.sh
@@ -23,7 +23,14 @@ preprocess() {
# get this value from config.h, however the autopkgtest fails with
# it
SYSTEM_UID_MAX=$(awk 'BEGIN { uid=999 } /^\s*SYS_UID_MAX\s+/ { uid=$2 } END { print uid }' /etc/login.defs)
- sed "s/SYSTEM_UID_MAX/${SYSTEM_UID_MAX}/g" "$in"
+
+ # we can't rely on config.h to get the nologin path, as autopkgtest
+ # uses pre-compiled binaries, so extract it from the systemd-sysusers
+ # binary which we are about to execute
+ NOLOGIN=$(strings $(type -p systemd-sysusers) | grep nologin)
+
+ sed -e "s/SYSTEM_UID_MAX/${SYSTEM_UID_MAX}/g" \
+ -e "s#NOLOGIN#${NOLOGIN}#g" "$in"
}
compare() {