From 09a6ddbe28ac8c1a174003d0395df1dff43cfb3e Mon Sep 17 00:00:00 2001 From: Waqas Hussain Date: Wed, 18 Nov 2009 06:22:52 +0500 Subject: mod_bosh: Set session.ip for BOSH sessions. --- plugins/mod_bosh.lua | 1 + 1 file changed, 1 insertion(+) (limited to 'plugins') diff --git a/plugins/mod_bosh.lua b/plugins/mod_bosh.lua index af13bde9..3e41ef7b 100644 --- a/plugins/mod_bosh.lua +++ b/plugins/mod_bosh.lua @@ -254,6 +254,7 @@ function stream_callbacks.handlestanza(request, stanza) if stanza.attr.xmlns == xmlns_bosh then stanza.attr.xmlns = "jabber:client"; end + session.ip = request.handler.ip(); core_process_stanza(session, stanza); end end -- cgit v1.2.3 From a0dc6018da763be5c2f4a97e89e2ef504c63811a Mon Sep 17 00:00:00 2001 From: Waqas Hussain Date: Wed, 18 Nov 2009 06:23:41 +0500 Subject: mod_register: Log a debug message when a session's IP is not available. --- plugins/mod_register.lua | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'plugins') diff --git a/plugins/mod_register.lua b/plugins/mod_register.lua index 22724130..2ae01fed 100644 --- a/plugins/mod_register.lua +++ b/plugins/mod_register.lua @@ -117,7 +117,9 @@ module:add_iq_handler("c2s_unauthed", "jabber:iq:register", function (session, s local password = query:child_with_name("password"); if username and password then -- Check that the user is not blacklisted or registering too often - if blacklisted_ips[session.ip] or (whitelist_only and not whitelisted_ips[session.ip]) then + if not session.ip then + module:log("debug", "User's IP not known; can't apply blacklist/whitelist"); + elseif blacklisted_ips[session.ip] or (whitelist_only and not whitelisted_ips[session.ip]) then session.send(st.error_reply(stanza, "cancel", "not-acceptable", "You are not allowed to register an account.")); return; elseif min_seconds_between_registrations and not whitelisted_ips[session.ip] then -- cgit v1.2.3 From 57af671e2b8242091cca9cadf73c89a028e421ec Mon Sep 17 00:00:00 2001 From: Waqas Hussain Date: Wed, 18 Nov 2009 08:30:03 +0500 Subject: mod_console: Moved activation of the console port from the main file to mod_console. --- plugins/mod_console.lua | 2 ++ 1 file changed, 2 insertions(+) (limited to 'plugins') diff --git a/plugins/mod_console.lua b/plugins/mod_console.lua index 5a092298..82045232 100644 --- a/plugins/mod_console.lua +++ b/plugins/mod_console.lua @@ -650,3 +650,5 @@ if option and option ~= "short" and option ~= "full" and option ~= "graphic" the end end end + +prosody.net_activate_ports("console", "console", {5582}, "tcp"); -- cgit v1.2.3