From: Theodore Ts'o Date: Tue, 1 Jan 2008 03:22:46 +0000 (-0500) Subject: debian: Use useradd and groupadd in favor of adduser X-Git-Tag: v1.40.4~4 X-Git-Url: https://git.whamcloud.com/?a=commitdiff_plain;h=46e770b2e23c18d27c351207601c0222484d6681;p=tools%2Fe2fsprogs.git 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" --- 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