From 31c0689963768851472a6d2d82328a9a63725a77 Mon Sep 17 00:00:00 2001 From: Kim Alvefur Date: Fri, 21 Apr 2017 14:34:53 +0200 Subject: prosodyctl: Verify that directory certs are written to exists --- prosodyctl | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'prosodyctl') 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; -- cgit v1.2.3