aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKim Alvefur <zash@zash.se>2017-04-21 14:34:53 +0200
committerKim Alvefur <zash@zash.se>2017-04-21 14:34:53 +0200
commitef9465a7615f478d22167826dc3600d0cf3915a2 (patch)
tree5f8ab45f0dd68fb3a534d9dbd7a5570f817adbcc
parentb5e6c7a6f559efb9010ece6ac05cd3fc5bc1cbb2 (diff)
downloadprosody-ef9465a7615f478d22167826dc3600d0cf3915a2.tar.gz
prosody-ef9465a7615f478d22167826dc3600d0cf3915a2.zip
prosodyctl: Verify that directory certs are written to exists
-rwxr-xr-xprosodyctl4
1 files changed, 4 insertions, 0 deletions
diff --git a/prosodyctl b/prosodyctl
index 86e2ccc4..74792c58 100755
--- a/prosodyctl
+++ b/prosodyctl
@@ -831,6 +831,10 @@ function commands.cert(arg)
openssl = require "util.openssl";
lfs = require "lfs";
local cert_dir_attrs = lfs.attributes(cert_basedir);
+ if not cert_dir_attrs then
+ show_warning("The directory "..cert_basedir.." does not exist");
+ return 1; -- TODO Should we create it?
+ end
if pposix.getuid() ~= cert_dir_attrs.uid then
show_warning("The directory "..cert_basedir.." is not owned by the current user, won't be able to write files to it");
return 1;