aboutsummaryrefslogtreecommitdiffstats
path: root/core/hostmanager.lua
diff options
context:
space:
mode:
authorMatthew Wild <mwild1@gmail.com>2013-03-22 11:24:54 +0000
committerMatthew Wild <mwild1@gmail.com>2013-03-22 11:24:54 +0000
commit77431e5d84383491a5ee673ce38f4912bd26c98b (patch)
tree21e71137f6aac454116922814a4aaf9bf4480c97 /core/hostmanager.lua
parent3ba555b9c5e925d138ee4a287f242f2c748f7100 (diff)
downloadprosody-77431e5d84383491a5ee673ce38f4912bd26c98b.tar.gz
prosody-77431e5d84383491a5ee673ce38f4912bd26c98b.zip
hostmanager: Use rawget to check for activated hosts to prevent recursion in dynamic host loaders
Diffstat (limited to 'core/hostmanager.lua')
-rw-r--r--core/hostmanager.lua4
1 files changed, 2 insertions, 2 deletions
diff --git a/core/hostmanager.lua b/core/hostmanager.lua
index 800f7b34..40401e48 100644
--- a/core/hostmanager.lua
+++ b/core/hostmanager.lua
@@ -25,7 +25,7 @@ end
local incoming_s2s = _G.prosody.incoming_s2s;
local core_route_stanza = _G.prosody.core_route_stanza;
-local pairs, select = pairs, select;
+local pairs, select, rawget = pairs, select, rawget;
local tostring, type = tostring, type;
module "hostmanager"
@@ -67,7 +67,7 @@ local function host_send(stanza)
end
function activate(host, host_config)
- if hosts[host] then return nil, "The host "..host.." is already activated"; end
+ if rawget(hosts, host) then return nil, "The host "..host.." is already activated"; end
host_config = host_config or configmanager.getconfig()[host];
if not host_config then return nil, "Couldn't find the host "..tostring(host).." defined in the current config"; end
local host_session = {