Software /
code /
prosody
Changeset
8108:939ccedb509d
prosodyctl: Verify that directory certs are written to exists
author | Kim Alvefur <zash@zash.se> |
---|---|
date | Fri, 21 Apr 2017 14:34:53 +0200 |
parents | 8107:83d776b344ad |
children | 8109:2f214c4db170 |
files | prosodyctl |
diffstat | 1 files changed, 4 insertions(+), 0 deletions(-) [+] |
line wrap: on
line diff
--- a/prosodyctl Fri Apr 21 14:24:59 2017 +0200 +++ b/prosodyctl Fri Apr 21 14:34:53 2017 +0200 @@ -831,6 +831,10 @@ 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;