* Create a _history user and group and a /var/lib/heimdal-history
directory on package installation for the use of heimdal-history,
remove the user and the standard database on purge, and remove the
directory if empty on package purge or removal.
* Add the upstream signing key to debian/upstream/signing-key.asc and
configure uscan to do signature validation. Configure uscan to
download the xz tarball instead of the gz tarball.
* Add the upstream signing key to debian/upstream/signing-key.asc and
configure uscan to do signature validation. Configure uscan to
download the xz tarball instead of the gz tarball.
+ * Create a _history user and group and a /var/lib/heimdal-history
+ directory on package installation for the use of heimdal-history,
+ remove the user and the standard database on purge, and remove the
+ directory if empty on package purge or removal.
-- Russ Allbery <rra@debian.org> Wed, 26 Mar 2014 00:04:13 -0700
-- Russ Allbery <rra@debian.org> Wed, 26 Mar 2014 00:04:13 -0700
--- /dev/null
+#!/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
--- /dev/null
+#!/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