]> eyrie.org Git - kerberos/krb5-strength.git/blobdiff - debian/postinst
Manage a _history user and the history database directory
[kerberos/krb5-strength.git] / debian / postinst
diff --git a/debian/postinst b/debian/postinst
new file mode 100755 (executable)
index 0000000..1f23e24
--- /dev/null
@@ -0,0 +1,20 @@
+#!/bin/sh
+
+set -e
+
+# Add a user to own the password history database.
+if ! getent passwd _history >/dev/null ; then
+    echo 'Adding system user for password history' 1>&2
+    adduser --disabled-login --quiet --system --no-create-home \
+        --home /var/lib/heimdal-history --force-badname --group _history
+fi
+
+# Create the directory for the history database, owned by the history user.
+if [ ! -d /var/lib/heimdal-history ] ; then
+    mkdir /var/lib/heimdal-history
+    chown _history:_history /var/lib/heimdal-history
+fi
+
+#DEBHELPER#
+
+exit 0