From 94c745e8e83bcabc945e93ebffb5f5eead5544bf Mon Sep 17 00:00:00 2001 From: Kim Alvefur Date: Fri, 18 Mar 2016 11:51:58 +0100 Subject: mod_saslauth: Disable DIGEST-MD5 by default (closes #515) --- plugins/mod_saslauth.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'plugins') diff --git a/plugins/mod_saslauth.lua b/plugins/mod_saslauth.lua index 7e9b0720..bb36600b 100644 --- a/plugins/mod_saslauth.lua +++ b/plugins/mod_saslauth.lua @@ -19,7 +19,7 @@ local tostring = tostring; local secure_auth_only = module:get_option_boolean("c2s_require_encryption", module:get_option_boolean("require_encryption", false)); local allow_unencrypted_plain_auth = module:get_option_boolean("allow_unencrypted_plain_auth", false) local insecure_mechanisms = module:get_option_set("insecure_sasl_mechanisms", allow_unencrypted_plain_auth and {} or {"PLAIN", "LOGIN"}); -local disabled_mechanisms = module:get_option_set("disable_sasl_mechanisms", {}); +local disabled_mechanisms = module:get_option_set("disable_sasl_mechanisms", { "DIGEST-MD5" }); local log = module._log; -- cgit v1.2.3 From 4b907ce3ffd17d7f2a1464156fd186506e6904c8 Mon Sep 17 00:00:00 2001 From: Matthew Wild Date: Fri, 18 Mar 2016 13:58:55 +0000 Subject: mod_component: Fire event when component disconnects --- plugins/mod_component.lua | 1 + 1 file changed, 1 insertion(+) (limited to 'plugins') diff --git a/plugins/mod_component.lua b/plugins/mod_component.lua index a5136f6c..7709d185 100644 --- a/plugins/mod_component.lua +++ b/plugins/mod_component.lua @@ -314,6 +314,7 @@ function listener.ondisconnect(conn, err) local session = sessions[conn]; if session then (session.log or log)("info", "component disconnected: %s (%s)", tostring(session.host), tostring(err)); + module:fire_event("component-disconnected", { session = session, reason = err }); if session.on_destroy then session:on_destroy(err); end sessions[conn] = nil; for k in pairs(session) do -- cgit v1.2.3 From f739ed2c46827cca1b0b7af08320584886e76283 Mon Sep 17 00:00:00 2001 From: Matthew Wild Date: Fri, 18 Mar 2016 14:03:14 +0000 Subject: mod_component: Some cleanup [luacheck] --- plugins/mod_component.lua | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'plugins') diff --git a/plugins/mod_component.lua b/plugins/mod_component.lua index 7709d185..eebaaf3e 100644 --- a/plugins/mod_component.lua +++ b/plugins/mod_component.lua @@ -40,7 +40,7 @@ function module.add_host(module) local send; - local function on_destroy(session, err) + local function on_destroy(session, err) --luacheck: ignore 212/err env.connected = false; env.session = false; send = nil; @@ -149,7 +149,7 @@ local stream_callbacks = { default_ns = xmlns_component }; local xmlns_xmpp_streams = "urn:ietf:params:xml:ns:xmpp-streams"; -function stream_callbacks.error(session, error, data, data2) +function stream_callbacks.error(session, error, data) if session.destroyed then return; end module:log("warn", "Error processing component stream: %s", tostring(error)); if error == "no-stream" then @@ -295,7 +295,7 @@ function listener.onconnect(conn) session.stream:reset(); end - function session.data(conn, data) + function session.data(_, data) local ok, err = stream:feed(data); if ok then return; end module:log("debug", "Received invalid XML (%s) %d bytes: %s", tostring(err), #data, data:sub(1, 300):gsub("[\r\n]+", " "):gsub("[%z\1-\31]", "_")); @@ -323,7 +323,6 @@ function listener.ondisconnect(conn, err) end end session.destroyed = true; - session = nil; end end -- cgit v1.2.3