# HG changeset patch # User Kim Alvefur # Date 1409047251 -7200 # Node ID fb1535328ac71323e6427131c847cf122c87e30d # Parent 13a43fe90d9f6583b0356b20da4bc2355a55a878 prosodyctl: Verify that 'pidfile' is a string, show friendly error otherwise diff -r 13a43fe90d9f -r fb1535328ac7 prosodyctl --- 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"; diff -r 13a43fe90d9f -r fb1535328ac7 util/prosodyctl.lua --- 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