diff options
author | Sean Whitton <spwhitton@spwhitton.name> | 2016-10-23 13:03:34 -0700 |
---|---|---|
committer | Sean Whitton <spwhitton@spwhitton.name> | 2016-10-23 13:03:34 -0700 |
commit | 144fddad929f4dc5d9ce730a0fdcea998fa546db (patch) | |
tree | f5c2ef74cc97ba0d750abf398e6510771033deb3 /debian | |
parent | 628fadf6d6959dd5d7c04fc325f3c9ba6078f18a (diff) | |
download | keysafe-144fddad929f4dc5d9ce730a0fdcea998fa546db.tar.gz |
check dir exists before chowning
Diffstat (limited to 'debian')
-rwxr-xr-x | debian/keysafe-server.postinst | 2 | ||||
-rwxr-xr-x | debian/keysafe-server.postrm | 4 |
2 files changed, 4 insertions, 2 deletions
diff --git a/debian/keysafe-server.postinst b/debian/keysafe-server.postinst index 38508cc..7282e29 100755 --- a/debian/keysafe-server.postinst +++ b/debian/keysafe-server.postinst @@ -6,7 +6,7 @@ if ! getent passwd _keysafe >/dev/null; then adduser --system --group --disabled-login --disabled-password \ --home /var/lib/keysafe --force-badname _keysafe chmod 700 /var/lib/keysafe -else +elif [ -d "/var/lib/keysafe" ]; then chown -R _keysafe:_keysafe /var/lib/keysafe fi diff --git a/debian/keysafe-server.postrm b/debian/keysafe-server.postrm index 1ee50af..10ebfea 100755 --- a/debian/keysafe-server.postrm +++ b/debian/keysafe-server.postrm @@ -8,7 +8,9 @@ set -e # delete the _keysafe user and group, after chowning the shard storage # to root so that it does not end up owned by another system user if [ "$1" = "purge" ]; then - chown -R root:root /var/lib/keysafe + if [ -e "/var/lib/keysafe" ]; then + chown -R root:root /var/lib/keysafe + fi userdel _keysafe || true groupdel _keysafe || true fi |