[Pkg-sks-commit] r34 - sks/trunk/sks/debian

chrism at alioth.debian.org chrism at alioth.debian.org
Thu Jun 19 14:37:27 UTC 2008


Author: chrism
Date: 2008-06-19 14:37:26 +0000 (Thu, 19 Jun 2008)
New Revision: 34

Modified:
   sks/trunk/sks/debian/postinst
Log:
[project @ 35]
creating user and checking uid and home

Original author: fabbione
Date: 2003-12-02 23:09:32.548037+00:00

Modified: sks/trunk/sks/debian/postinst
===================================================================
--- sks/trunk/sks/debian/postinst	2008-06-19 14:37:20 UTC (rev 33)
+++ sks/trunk/sks/debian/postinst	2008-06-19 14:37:26 UTC (rev 34)
@@ -1,5 +1,48 @@
 #!/bin/sh -e
 
+# checking debian-sks account
+
+# this is ugly but it works around a silly problem of grep
+# exits code.
+
+uid=`getent passwd | grep "^debian-sks:" | cut -d ":" -f 3`
+home=`getent passwd | grep "^debian-sks:" | cut -d ":" -f 6`
+
+# if there is the uid the account is there and we can do
+# the sanit(ar)y checks otherwise we can safely create it.
+
+if [ "$uid" ]; then
+    # guess??? the checks!!!
+    if [ $uid -ge 100 ] && [ $uid -le 999 ]; then
+	if [ "$home" != "/var/lib/sks" ]; then
+	    echo "ERROR: debian-sks account has an invalid home directory!"
+	    echo "Please check /usr/share/doc/sks/README.Debian on how to"
+	    echo "correct this problem"
+	    exit 1
+	fi
+    else
+    	echo "ERROR: debian-sks account has a non-system uid!"
+	echo "Please check /usr/share/doc/sks/README.Debian on how to"
+	echo "correct this problem"
+	exit 1
+    fi
+else
+    # what this might mean?? oh creating a system l^Huser!
+    adduser --quiet \
+            --system \
+            --disabled-password \
+            --home /var/lib/sks \
+	    --no-create-home \
+    debian-sks
+fi
+
+# chowning things around
+chown -R debian-sks \
+	var/lib/sks \
+	var/log/sks \
+	var/run/sks \
+	var/spool/sks
+
 #DEBHELPER#
 
 exit 0




More information about the Pkg-sks-commit mailing list