diff options
author | Erich Eckner <git@eckner.net> | 2019-09-23 10:45:38 +0200 |
---|---|---|
committer | Erich Eckner <git@eckner.net> | 2019-09-23 10:45:38 +0200 |
commit | 491682978b3434153cf51c68ef0721828d0d1c07 (patch) | |
tree | 2c9b10f306ec452203b0aa16376055d952822247 | |
parent | 8e447f5e3a2e7080d2194e8dac453119e2a39be4 (diff) | |
download | simple-pki-491682978b3434153cf51c68ef0721828d0d1c07.tar.xz |
rotate-keys: abort if tmp_dir cannot be created
-rw-r--r-- | rotate-keys.in | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/rotate-keys.in b/rotate-keys.in index 970d533..952595b 100644 --- a/rotate-keys.in +++ b/rotate-keys.in @@ -82,7 +82,12 @@ if trap \ exit 1 fi -tmp_dir=$(mktemp -d "${webserver_dir}"'/tmp.XXXXXXXXXX') +if ! tmp_dir=$(mktemp -d "${webserver_dir}"'/tmp.XXXXXXXXXX'); then + >&2 printf 'failed to create temporary directory - does %s have sufficient permissions on "%s"?\n' \ + "$(whoami)" \ + "${webserver_dir}" + exit 1 +fi trap 'rm -rf --one-file-system "${tmp_dir}"' EXIT printf '%s\n' "${hosts}" \ |