chiark / gitweb /
Changed code so that it verifies that user and group were created successfully
authorjfs <jfs@313b444b-1b9f-4f58-a734-7bb04f332e8d>
Tue, 1 Nov 2005 20:38:03 +0000 (20:38 +0000)
committerjfs <jfs@313b444b-1b9f-4f58-a734-7bb04f332e8d>
Tue, 1 Nov 2005 20:38:03 +0000 (20:38 +0000)
git-svn-id: svn://anonscm.debian.org/ddp/manuals/trunk/developers-reference@3582 313b444b-1b9f-4f58-a734-7bb04f332e8d

developers-reference.sgml

index 3e48ac3d8ccba9b329658b5b97a9fe105e7aad7e..1875e124431ef08db9067ced370dc9d93adcc698 100644 (file)
@@ -7,7 +7,7 @@
   <!ENTITY % dynamicdata  SYSTEM "dynamic.ent" > %dynamicdata;
 
   <!-- CVS revision of this document -->
-  <!ENTITY cvs-rev "$Revision: 1.277 $">
+  <!ENTITY cvs-rev "$Revision: 1.278 $">
 
   <!-- if you are translating this document, please notate the CVS
        revision of the original developer's reference in cvs-en-rev -->
@@ -4219,9 +4219,13 @@ case "$1" in
        # create user to avoid running server as root
        # 1. create group if not existing
        if ! getent group | grep -q "^$SERVER_GROUP:" ; then
-             echo -n "Adding group $SERVER_GROUP.."
-             addgroup --quiet --system $SERVER_GROUP 2>/dev/null ||true
-            echo "..done"
+             echo -n "Adding system group $SERVER_GROUP.."
+             addgroup --quiet --system $SERVER_GROUP 
+             if ! getent group | grep -q "^$SERVER_GROUP:"; then
+               echo "..ERROR creating system group. Aborting installation."
+              exit 1
+            fi
+           echo "..done"
        fi
        # 2. create homedir if it does not exist
        test -d $SERVER_HOME || mkdir $SERVER_HOME
@@ -4233,7 +4237,11 @@ case "$1" in
                --ingroup $SERVER_GROUP \
                --no-create-home \
                --disabled-password \
-               $SERVER_USER 2>/dev/null || true
+               $SERVER_USER 
+           if ! getent passwd | grep -q "^$SERVER_USER:"; then
+             echo "..ERROR creating system user. Aborting installation."
+             exit 1
+          fi
            echo "..done"
            # 4. adjust passwd entry, only do this if the package
            # creates the user