From 46e770b2e23c18d27c351207601c0222484d6681 Mon Sep 17 00:00:00 2001 From: Theodore Ts'o Date: Mon, 31 Dec 2007 22:22:46 -0500 Subject: [PATCH] debian: Use useradd and groupadd in favor of adduser The adduser package is 'important', and while it is often installed, we can't guarantee that it will always be there. A required package, or a package which is dragged in by a required package, such as libuuid1, shouldn't depend on an 'important' package since that would implicitly make it be required, which shouldn't be done unless absolutely necesary. So we replace the call to adduser with the lower-level useradd and groupadd programs. They are part of the passwd package, which is required to be on all Debian systems. Signed-off-by: "Theodore Ts'o" --- debian/libuuid1.postinst | 7 ++++--- debian/uuid-runtime.postinst | 6 ++++-- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/debian/libuuid1.postinst b/debian/libuuid1.postinst index 8559ffc..9d8bcf3 100644 --- a/debian/libuuid1.postinst +++ b/debian/libuuid1.postinst @@ -1,8 +1,9 @@ #!/bin/sh -adduser --system --group --no-create-home --disabled-login \ - --quiet --home /var/lib/libuuid libuuid +groupadd -f -K GID_MIN=1 -K GID_MAX=999 libuuid +if ! grep -q libuuid /etc/passwd; then + useradd -d /var/lib/libuuid -K UID_MIN=1 -K UID_MAX=499 -g libuuid libuuid +fi mkdir -p /var/lib/libuuid chown libuuid:libuuid /var/lib/libuuid chmod 2775 /var/lib/libuuid - diff --git a/debian/uuid-runtime.postinst b/debian/uuid-runtime.postinst index 8d3be77..b7e4d0b 100644 --- a/debian/uuid-runtime.postinst +++ b/debian/uuid-runtime.postinst @@ -1,6 +1,8 @@ #!/bin/sh -adduser --system --group --no-create-home --disabled-login \ - --quiet --home /var/lib/libuuid libuuid +groupadd -f -K GID_MIN=1 -K GID_MAX=999 libuuid +if ! grep -q libuuid /etc/passwd; then + useradd -d /var/lib/libuuid -K UID_MIN=1 -K UID_MAX=499 -g libuuid libuuid +fi chown libuuid:libuuid /usr/sbin/uuidd chmod 6755 /usr/sbin/uuidd -- 1.8.3.1