From 4ceaa9d2f2c9ee0fd0dfed102f214e533955a838 Mon Sep 17 00:00:00 2001 From: Matthew Wild Date: Fri, 22 Mar 2013 14:31:14 +0000 Subject: mod_s2s: Remove unused variable --- plugins/mod_s2s/mod_s2s.lua | 1 - 1 file changed, 1 deletion(-) diff --git a/plugins/mod_s2s/mod_s2s.lua b/plugins/mod_s2s/mod_s2s.lua index 512c9037..80f06eb9 100644 --- a/plugins/mod_s2s/mod_s2s.lua +++ b/plugins/mod_s2s/mod_s2s.lua @@ -423,7 +423,6 @@ local listener = {}; --- Session methods local stream_xmlns_attr = {xmlns='urn:ietf:params:xml:ns:xmpp-streams'}; -local default_stream_attr = { ["xmlns:stream"] = "http://etherx.jabber.org/streams", xmlns = stream_callbacks.default_ns, version = "1.0", id = "" }; local function session_close(session, reason, remote_reason) local log = session.log or log; if session.conn then -- cgit v1.2.3 From 5f6e150c615ad3e86b2d56aeebe0d8a329eba645 Mon Sep 17 00:00:00 2001 From: Matthew Wild Date: Fri, 22 Mar 2013 14:50:29 +0000 Subject: s2smanager: Access prosody.hosts instead of hosts global directly --- core/s2smanager.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/s2smanager.lua b/core/s2smanager.lua index b034fcae..a6e39705 100644 --- a/core/s2smanager.lua +++ b/core/s2smanager.lua @@ -8,7 +8,7 @@ -local hosts = hosts; +local hosts = prosody.hosts; local tostring, pairs, getmetatable, newproxy, setmetatable = tostring, pairs, getmetatable, newproxy, setmetatable; -- cgit v1.2.3 From c908af2a7d0aaf8c7448273fc57a2b284fb5fb29 Mon Sep 17 00:00:00 2001 From: Matthew Wild Date: Fri, 22 Mar 2013 14:50:43 +0000 Subject: s2smanager: Remove unused function parameter --- core/s2smanager.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/s2smanager.lua b/core/s2smanager.lua index a6e39705..5777cb8e 100644 --- a/core/s2smanager.lua +++ b/core/s2smanager.lua @@ -38,7 +38,7 @@ function new_incoming(conn) return session; end -function new_outgoing(from_host, to_host, connect) +function new_outgoing(from_host, to_host) local host_session = { to_host = to_host, from_host = from_host, host = from_host, notopen = true, type = "s2sout_unauthed", direction = "outgoing" }; hosts[from_host].s2sout[to_host] = host_session; -- cgit v1.2.3 From 68a7de369b8d2b5701ef6403ce6d3f8d4e7e8fa9 Mon Sep 17 00:00:00 2001 From: Matthew Wild Date: Fri, 22 Mar 2013 15:16:22 +0000 Subject: mod_s2s: Fix variable usage in check_auth_policy (thanks Florob) --- plugins/mod_s2s/mod_s2s.lua | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/plugins/mod_s2s/mod_s2s.lua b/plugins/mod_s2s/mod_s2s.lua index 80f06eb9..ec969cc3 100644 --- a/plugins/mod_s2s/mod_s2s.lua +++ b/plugins/mod_s2s/mod_s2s.lua @@ -610,14 +610,15 @@ end function check_auth_policy(event) local host, session = event.host, event.session; - - if not secure_auth and secure_domains[host] then - secure_auth = true; - elseif secure_auth and insecure_domains[host] then - secure_auth = false; + local must_secure = secure_auth; + + if not must_secure and secure_domains[host] then + must_secure = true; + elseif must_secure and insecure_domains[host] then + must_secure = false; end - if secure_auth and not session.cert_identity_status then + if must_secure and not session.cert_identity_status then module:log("warn", "Forbidding insecure connection to/from %s", host); session:close(false); return false; -- cgit v1.2.3