Software /
code /
prosody
Comparison
util/prosodyctl.lua @ 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 |
parent | 5524:e9090966c803 |
child | 6367:769a3577dd85 |
comparison
equal
deleted
inserted
replaced
6325:13a43fe90d9f | 6356:fb1535328ac7 |
---|---|
186 function getpid() | 186 function getpid() |
187 local pidfile = config.get("*", "pidfile"); | 187 local pidfile = config.get("*", "pidfile"); |
188 if not pidfile then | 188 if not pidfile then |
189 return false, "no-pidfile"; | 189 return false, "no-pidfile"; |
190 end | 190 end |
191 | |
192 if type(pidfile) ~= "string" then | |
193 return false, "invalid-pidfile"; | |
194 end | |
191 | 195 |
192 local modules_enabled = set.new(config.get("*", "modules_enabled")); | 196 local modules_enabled = set.new(config.get("*", "modules_enabled")); |
193 if not modules_enabled:contains("posix") then | 197 if not modules_enabled:contains("posix") then |
194 return false, "no-posix"; | 198 return false, "no-posix"; |
195 end | 199 end |