From 62a0b065abd821d24ef38648db63e53815e064eb Mon Sep 17 00:00:00 2001 From: HW42 Date: Thu, 5 Feb 2015 04:22:48 +0100 Subject: [PATCH] debian: preinst: cleanup user creation Generate user-groups via -U instead of explicit via groupadd. This also fix the problem that the tinyproxy group were not gererated as "system"-group. Also suppress unneeded output of the existence test. --- debian/qubes-core-agent.preinst | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/debian/qubes-core-agent.preinst b/debian/qubes-core-agent.preinst index 0302e29..aeda08e 100755 --- a/debian/qubes-core-agent.preinst +++ b/debian/qubes-core-agent.preinst @@ -56,13 +56,11 @@ if [ "$1" = "install" ] ; then # -------------------------------------------------------------------------- # User add / modifications # -------------------------------------------------------------------------- - id -u 'user' || { - groupadd -f user - useradd -g user -G dialout,cdrom,floppy,sudo,audio,dip,video,plugdev -m -s /bin/bash user + id -u 'user' >/dev/null 2>&1 || { + useradd -U -G dialout,cdrom,floppy,sudo,audio,dip,video,plugdev -m -s /bin/bash user } - id -u 'tinyproxy' || { - groupadd -f tinyproxy - useradd -g tinyproxy -r -M --home /run/tinyproxy --shell /bin/false tinyproxy + id -u 'tinyproxy' >/dev/null 2>&1 || { + useradd -U -r -M --home /run/tinyproxy --shell /bin/false tinyproxy } usermod -p '' root usermod -L user