Changeset

6356:fb1535328ac7

prosodyctl: Verify that 'pidfile' is a string, show friendly error otherwise
author Kim Alvefur <zash@zash.se>
date Tue, 26 Aug 2014 12:00:51 +0200
parents 6325:13a43fe90d9f
children 6357:ccae56e34956
files prosodyctl util/prosodyctl.lua
diffstat 2 files changed, 5 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/prosodyctl	Thu Jul 31 06:59:12 2014 +0100
+++ b/prosodyctl	Tue Aug 26 12:00:51 2014 +0200
@@ -220,6 +220,7 @@
 		["no-such-host"] = "The given hostname does not exist in the config";
 		["unable-to-save-data"] = "Unable to store, perhaps you don't have permission?";
 		["no-pidfile"] = "There is no 'pidfile' option in the configuration file, see http://prosody.im/doc/prosodyctl#pidfile for help";
+		["invalid-pidfile"] = "The 'pidfile' option in the configuration file is not a string, see http://prosody.im/doc/prosodyctl#pidfile for help";
 		["no-posix"] = "The mod_posix module is not enabled in the Prosody config file, see http://prosody.im/doc/prosodyctl for more info";
 		["no-such-method"] = "This module has no commands";
 		["not-running"] = "Prosody is not running";
--- a/util/prosodyctl.lua	Thu Jul 31 06:59:12 2014 +0100
+++ b/util/prosodyctl.lua	Tue Aug 26 12:00:51 2014 +0200
@@ -188,6 +188,10 @@
 	if not pidfile then
 		return false, "no-pidfile";
 	end
+
+	if type(pidfile) ~= "string" then
+		return false, "invalid-pidfile";
+	end
 	
 	local modules_enabled = set.new(config.get("*", "modules_enabled"));
 	if not modules_enabled:contains("posix") then