]> eyrie.org Git - kerberos/krb5-strength.git/blobdiff - debian/postrm
Manage a _history user and the history database directory
[kerberos/krb5-strength.git] / debian / postrm
diff --git a/debian/postrm b/debian/postrm
new file mode 100755 (executable)
index 0000000..b6cf353
--- /dev/null
@@ -0,0 +1,21 @@
+#!/bin/sh
+
+set -e
+
+# Purge the password history database and remove the _history user and group
+# on package purge.  This user should not be used for any other purpose.
+if [ "$1" = purge ] ; then
+    for file in history.db history.db.lock lengths.db lengths.db.lock ; do
+        rm -f "/var/lib/heimdal-history/$file"
+    done
+    deluser --quiet --system _history >/dev/null || true
+fi
+
+# Remove the directory for the password history database on remove if empty.
+if [ "$1" = purge ] || [ "$1" = remove ] ; then
+    rmdir --ignore-fail-on-non-empty /var/lib/heimdal-history
+fi
+
+#DEBHELPER#
+
+exit 0