Skip to content
Snippets Groups Projects
Commit a2344f4e authored by Martin Pitt's avatar Martin Pitt Committed by Michael Biebl
Browse files

Fix wrong "nobody" group from sysusers.d

Fix our make-sysusers-basic sysusers.d generator to special-case the
nobody group. "nobody" user and "nogroup" group both have the same ID
65534, which is the only special case for Debian's static users/groups.
So specify the gid explicitly, to avoid systemd-sysusers creating a
dynamic system group for "nobody".

Also clean up the group on upgrades.

Thanks to Keh-Ming Luoh for the original patch!

Closes: #912525
parent 159a78a8
No related branches found
No related tags found
No related merge requests found
......@@ -14,4 +14,5 @@ done < /usr/share/base-passwd/group.master
echo
awk -F: '{ i = ($3 == $4) ? $3 : $3":"$4; printf("u %-10s %-7s - %-20s %s\n", $1,i,$6,$7) }' < /usr/share/base-passwd/passwd.master
# 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
......@@ -155,4 +155,13 @@ if dpkg --compare-versions "$2" lt-nl "236-1~"; then
rm -f /var/lib/systemd/clock
fi
if dpkg --compare-versions "$2" lt-nl "239-12~"; then
# clean up bogus "nobody" group from #912525; ensure that it's a system group
gid=$(grep '^nobody:x:' /etc/group | cut -f3 -d:)
if [ -n "$gid" ] && [ "$gid" -gt 0 ] && [ "$gid" -lt 1000 ]; then
echo "Cleaning up erroneous nobody group"
sed -i '/^nobody:x:/d' /etc/group
fi
fi
#DEBHELPER#
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment