summaryrefslogtreecommitdiffstats
path: root/debian/extra/make-sysusers-basic
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-10 20:49:53 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-10 20:49:53 +0000
commit87aefc960557c2fb6fdf9ea4c1ac0e7983f68f68 (patch)
tree263fc56d7d40512aaa09193905008a3f4e3b0018 /debian/extra/make-sysusers-basic
parentAdding upstream version 255.4. (diff)
downloadsystemd-87aefc960557c2fb6fdf9ea4c1ac0e7983f68f68.tar.xz
systemd-87aefc960557c2fb6fdf9ea4c1ac0e7983f68f68.zip
Adding debian version 255.4-1.debian/255.4-1
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'debian/extra/make-sysusers-basic')
-rwxr-xr-xdebian/extra/make-sysusers-basic18
1 files changed, 18 insertions, 0 deletions
diff --git a/debian/extra/make-sysusers-basic b/debian/extra/make-sysusers-basic
new file mode 100755
index 0000000..8ff1b15
--- /dev/null
+++ b/debian/extra/make-sysusers-basic
@@ -0,0 +1,18 @@
+#!/bin/sh
+# generate a sysusers.d(5) file from Debian's static master passwd/group files
+set -eu
+
+echo '# generated from /usr/share/base-passwd/{passwd,group}.master'
+
+# only take groups whose name+gid != the corresponding user in passwd.master
+export IFS=:
+while read name _ id _; do
+ if ! grep -q "^$name:\*:$id:$id:" /usr/share/base-passwd/passwd.master; then
+ printf "g %-10s %-5s -\n" $name $id
+ fi
+done < /usr/share/base-passwd/group.master
+
+echo
+
+# treat "nobody:nogroup" specially: same ID, but different name, so prevent creating a "nobody" group
+awk -F: '{ i = ($3 == $4 && $4 != 65534) ? $3 : $3":"$4; printf("u %-10s %-7s - %-20s %s\n", $1,i,$6,$7) }' < /usr/share/base-passwd/passwd.master