From e8872af8a09454fbeff06eefbd75d7967d468f9a Mon Sep 17 00:00:00 2001 From: Kim Alvefur Date: Sat, 8 Jul 2017 18:21:45 +0200 Subject: mod_saslauth: Use correct varible name (thanks Roi) --- plugins/mod_saslauth.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/mod_saslauth.lua b/plugins/mod_saslauth.lua index d374633e..a23d1f53 100644 --- a/plugins/mod_saslauth.lua +++ b/plugins/mod_saslauth.lua @@ -105,7 +105,7 @@ module:hook_stanza(xmlns_sasl, "failure", function (session, stanza) end end if text and condition then - condition = connection .. ": " .. text; + condition = condition .. ": " .. text; end module:log("info", "SASL EXTERNAL with %s failed: %s", session.to_host, condition); -- cgit v1.2.3 From 255073d6c9ea8b7718704ec4e8a1aeb524363eed Mon Sep 17 00:00:00 2001 From: Kim Alvefur Date: Tue, 25 Jul 2017 13:16:31 +0200 Subject: util.dependencies: Add compatibility code for LuaSocket no longer exporting as a global --- util/dependencies.lua | 3 +++ 1 file changed, 3 insertions(+) diff --git a/util/dependencies.lua b/util/dependencies.lua index 491bfd9b..a259c263 100644 --- a/util/dependencies.lua +++ b/util/dependencies.lua @@ -79,6 +79,9 @@ function check_dependencies() ["Source"] = "http://www.tecgraf.puc-rio.br/~diego/professional/luasocket/"; }); fatal = true; + elseif not _G.socket then + -- COMPAT Code expecting LuaSocket to export as a global + _G.socket = socket; end local lfs, err = softreq "lfs" -- cgit v1.2.3 From 9437d97a37b16df525d134101ec059c19f470fce Mon Sep 17 00:00:00 2001 From: Kim Alvefur Date: Tue, 25 Jul 2017 13:25:49 +0200 Subject: util.dependencies: Add comment about LuaSec compat --- util/dependencies.lua | 1 + 1 file changed, 1 insertion(+) diff --git a/util/dependencies.lua b/util/dependencies.lua index a259c263..7ec56022 100644 --- a/util/dependencies.lua +++ b/util/dependencies.lua @@ -103,6 +103,7 @@ function check_dependencies() ["Source"] = "http://www.inf.puc-rio.br/~brunoos/luasec/"; }, "SSL/TLS support will not be available"); elseif not _G.ssl then + -- COMPAT Code expecting LuaSec to export as a global (see #749) _G.ssl = ssl; _G.ssl.context = require "ssl.context"; _G.ssl.x509 = softreq "ssl.x509"; -- cgit v1.2.3 From 12cdea49b391a7b2dea63856f4a689ed5668ea09 Mon Sep 17 00:00:00 2001 From: Kim Alvefur Date: Wed, 13 Sep 2017 18:18:57 +0200 Subject: mod_c2s: Iterate over child tags instead of child nodes in stream error (fixes traceback from #987) --- plugins/mod_c2s.lua | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) diff --git a/plugins/mod_c2s.lua b/plugins/mod_c2s.lua index 2bb919f8..fdb3b211 100644 --- a/plugins/mod_c2s.lua +++ b/plugins/mod_c2s.lua @@ -98,16 +98,14 @@ function stream_callbacks.error(session, error, data) session:close("not-well-formed"); elseif error == "stream-error" then local condition, text = "undefined-condition"; - for child in data:children() do - if child.attr.xmlns == xmlns_xmpp_streams then - if child.name ~= "text" then - condition = child.name; - else - text = child:get_text(); - end - if condition ~= "undefined-condition" and text then - break; - end + for child in data:childtags(nil, xmlns_xmpp_streams) do + if child.name ~= "text" then + condition = child.name; + else + text = child:get_text(); + end + if condition ~= "undefined-condition" and text then + break; end end text = condition .. (text and (" ("..text..")") or ""); -- cgit v1.2.3 From 5dee36d8385e36c4d72a97a33cf3c934af3d6633 Mon Sep 17 00:00:00 2001 From: Kim Alvefur Date: Thu, 14 Sep 2017 01:27:36 +0200 Subject: mod_component, mod_s2s: Iterate over child tags instead of child nodes (can include text) in stream error (same as 176b7f4e4ac9) --- plugins/mod_component.lua | 18 ++++++++---------- plugins/mod_s2s/mod_s2s.lua | 18 ++++++++---------- 2 files changed, 16 insertions(+), 20 deletions(-) diff --git a/plugins/mod_component.lua b/plugins/mod_component.lua index 11abab79..acd70c60 100644 --- a/plugins/mod_component.lua +++ b/plugins/mod_component.lua @@ -151,16 +151,14 @@ function stream_callbacks.error(session, error, data, data2) session:close("not-well-formed"); elseif error == "stream-error" then local condition, text = "undefined-condition"; - for child in data:children() do - if child.attr.xmlns == xmlns_xmpp_streams then - if child.name ~= "text" then - condition = child.name; - else - text = child:get_text(); - end - if condition ~= "undefined-condition" and text then - break; - end + for child in data:childtags(nil, xmlns_xmpp_streams) do + if child.name ~= "text" then + condition = child.name; + else + text = child:get_text(); + end + if condition ~= "undefined-condition" and text then + break; end end text = condition .. (text and (" ("..text..")") or ""); diff --git a/plugins/mod_s2s/mod_s2s.lua b/plugins/mod_s2s/mod_s2s.lua index e038e5b4..10b81a17 100644 --- a/plugins/mod_s2s/mod_s2s.lua +++ b/plugins/mod_s2s/mod_s2s.lua @@ -416,16 +416,14 @@ function stream_callbacks.error(session, error, data) session:close("not-well-formed"); elseif error == "stream-error" then local condition, text = "undefined-condition"; - for child in data:children() do - if child.attr.xmlns == xmlns_xmpp_streams then - if child.name ~= "text" then - condition = child.name; - else - text = child:get_text(); - end - if condition ~= "undefined-condition" and text then - break; - end + for child in data:childtags(nil, xmlns_xmpp_streams) do + if child.name ~= "text" then + condition = child.name; + else + text = child:get_text(); + end + if condition ~= "undefined-condition" and text then + break; end end text = condition .. (text and (" ("..text..")") or ""); -- cgit v1.2.3