aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--plugins/mod_component.lua3
-rw-r--r--plugins/mod_dialback.lua10
-rw-r--r--plugins/mod_saslauth.lua9
3 files changed, 18 insertions, 4 deletions
diff --git a/plugins/mod_component.lua b/plugins/mod_component.lua
index 33b1852b..46db31b6 100644
--- a/plugins/mod_component.lua
+++ b/plugins/mod_component.lua
@@ -120,7 +120,8 @@ function module.add_host(module)
local name = module:get_option_string("name");
if name then
event.origin.send(st.reply(stanza):tag("query", { xmlns = "http://jabber.org/protocol/disco#info" })
- :tag("identity", { category = "component", type = "generic", name = module:get_option_string("name", "Prosody") }))
+ :tag("identity", { category = "component", type = "generic", name = module:get_option_string("name", "Prosody") })):up()
+ :tag("feature", { var = "http://jabber.org/protocol/disco#info" }):up()
return true;
end
end
diff --git a/plugins/mod_dialback.lua b/plugins/mod_dialback.lua
index cbff7f67..eddc3209 100644
--- a/plugins/mod_dialback.lua
+++ b/plugins/mod_dialback.lua
@@ -153,7 +153,7 @@ module:hook("stanza/jabber:server:dialback:verify", function(event)
valid = "invalid";
end
if dialback_verifying.destroyed then
- log("warn", "Incoming s2s session %s was closed in the meantime, so we can't notify it of the db result",
+ log("warn", "Incoming s2s session %s was closed in the meantime, so we can't notify it of the dialback result",
tostring(dialback_verifying):match("%w+$"));
else
dialback_verifying.sends2s(
@@ -190,6 +190,14 @@ module:hook("stanza/jabber:server:dialback:result", function(event)
end
end);
+module:hook_tag("urn:ietf:params:xml:ns:xmpp-sasl", "failure", function (origin, stanza) -- luacheck: ignore 212/stanza
+ if origin.external_auth == "failed" then
+ module:log("debug", "SASL EXTERNAL failed, falling back to dialback");
+ initiate_dialback(origin);
+ return true;
+ end
+end, 100);
+
module:hook_tag(xmlns_stream, "features", function (origin, stanza) -- luacheck: ignore 212/stanza
if not origin.external_auth or origin.external_auth == "failed" then
module:log("debug", "Initiating dialback...");
diff --git a/plugins/mod_saslauth.lua b/plugins/mod_saslauth.lua
index b5ec4057..fba84ef8 100644
--- a/plugins/mod_saslauth.lua
+++ b/plugins/mod_saslauth.lua
@@ -110,10 +110,15 @@ module:hook_tag(xmlns_sasl, "failure", function (session, stanza)
module:log("info", "SASL EXTERNAL with %s failed: %s", session.to_host, condition);
session.external_auth = "failed"
- session:close();
- return true;
+ session.external_auth_failure_reason = condition;
end, 500)
+module:hook_tag(xmlns_sasl, "failure", function (session, stanza) -- luacheck: ignore 212/stanza
+ session.log("debug", "No fallback from SASL EXTERNAL failure, giving up");
+ session:close(nil, session.external_auth_failure_reason);
+ return true;
+end, 90)
+
module:hook_tag("http://etherx.jabber.org/streams", "features", function (session, stanza)
if session.type ~= "s2sout_unauthed" or not session.secure then return; end