From 9f59c549b2b19b5222a6625469170a4e787e3db5 Mon Sep 17 00:00:00 2001 From: Kim Alvefur Date: Sat, 22 Mar 2014 12:02:11 +0100 Subject: prosodyctl: Show real error if certificate config file can't be opened --- prosodyctl | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) 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(""); -- cgit v1.2.3