aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKim Alvefur <zash@zash.se>2014-03-22 12:02:11 +0100
committerKim Alvefur <zash@zash.se>2014-03-22 12:02:11 +0100
commitaff3965927ff8763b477b97a4be4f477186738a0 (patch)
tree9a9f2b027b67c6b28cfc2ac229a981a2babcc529
parent09b294259247d94ae86e14fe52a27e98f06a6c88 (diff)
downloadprosody-aff3965927ff8763b477b97a4be4f477186738a0.tar.gz
prosody-aff3965927ff8763b477b97a4be4f477186738a0.zip
prosodyctl: Show real error if certificate config file can't be opened
-rwxr-xr-xprosodyctl7
1 files changed, 6 insertions, 1 deletions
diff --git a/prosodyctl b/prosodyctl
index 247b099a..d341a75b 100755
--- a/prosodyctl
+++ b/prosodyctl
@@ -684,7 +684,12 @@ function cert_commands.config(arg)
conf.distinguished_name[k] = nv ~= "." and nv or nil;
end
end
- local conf_file = io.open(conf_filename, "w");
+ local conf_file, err = io.open(conf_filename, "w");
+ if not conf_file then
+ show_warning("Could not open OpenSSL config file for writing");
+ show_warning(err);
+ os.exit(1);
+ end
conf_file:write(conf:serialize());
conf_file:close();
print("");