Whamcloud - gitweb
debian: Fix postinstall scripts when the user/group is in LDAP
authorTheodore Ts'o <tytso@mit.edu>
Fri, 29 Aug 2008 23:53:34 +0000 (19:53 -0400)
committerTheodore Ts'o <tytso@mit.edu>
Sat, 30 Aug 2008 00:03:03 +0000 (20:03 -0400)
Addresses-Debian-Bug: #497010

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
debian/libuuid1.postinst
debian/uuid-runtime.postinst

index 27ca205..5336fcf 100644 (file)
@@ -24,9 +24,10 @@ if test -z "$LAST_SYSTEM_GID"; then
     LAST_SYSTEM_GID=999
 fi
 
-groupadd -f -K GID_MIN=$FIRST_SYSTEM_GID -K GID_MAX=$LAST_SYSTEM_GID libuuid
-
-if ! grep -q libuuid /etc/passwd; then
+if ! getent group | grep -q libuuid; then
+  groupadd -f -K GID_MIN=$FIRST_SYSTEM_GID -K GID_MAX=$LAST_SYSTEM_GID libuuid
+fi
+if ! getent passwd | grep -q libuuid; then
    useradd -d /var/lib/libuuid -K UID_MIN=$FIRST_SYSTEM_UID -K UID_MAX=$LAST_SYSTEM_UID -g libuuid libuuid
 fi
 
index 36cd7b9..3c1adb6 100644 (file)
@@ -1,8 +1,10 @@
 #!/bin/sh
 
 set -e
+if ! getent group | grep -q libuuid; then
 groupadd -f -K GID_MIN=1 -K GID_MAX=999 libuuid
-if ! grep -q libuuid /etc/passwd; then
+fi
+if ! getent passwd | grep -q libuuid; then
    useradd -d /var/lib/libuuid -K UID_MIN=1 -K UID_MAX=499 -g libuuid libuuid
 fi
 chown libuuid:libuuid /usr/sbin/uuidd