aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--plugins/mod_auth_anonymous.lua1
-rw-r--r--plugins/mod_dialback.lua18
-rw-r--r--plugins/muc/muc.lib.lua6
3 files changed, 19 insertions, 6 deletions
diff --git a/plugins/mod_auth_anonymous.lua b/plugins/mod_auth_anonymous.lua
index 55398d8a..5df81f24 100644
--- a/plugins/mod_auth_anonymous.lua
+++ b/plugins/mod_auth_anonymous.lua
@@ -52,6 +52,7 @@ local function dm_callback(username, host, datastore, data)
end
if module:get_option_boolean("disallow_s2s", true) then
+ hosts[module.host].disallow_s2s = true;
module:hook("route/remote", function (event)
return false; -- Block outgoing s2s from anonymous users
end, 300);
diff --git a/plugins/mod_dialback.lua b/plugins/mod_dialback.lua
index 5d32fdb2..4b19f2d9 100644
--- a/plugins/mod_dialback.lua
+++ b/plugins/mod_dialback.lua
@@ -76,21 +76,29 @@ module:hook("stanza/jabber:server:dialback:result", function(event)
dialback_requests[attr.from.."/"..origin.streamid] = origin;
+ local compat_check;
if not origin.from_host then
-- Just used for friendlier logging
origin.from_host = nameprep(attr.from);
- -- COMPAT: Fix ejabberd chopness by resetting the send function
if not origin.from_host then
origin.log("debug", "We need to know where to connect but remote server blindly refuses to tell us and to comply to specs, closing connection.");
origin:close("invalid-from");
- else
- origin.log("debug", "Remote server didn't specify a from attr, resetting session.send now that we know where to knock to.");
- origin.send = function(stanza) hosts[attr.to].events.fire_event("route/remote", { from_host = origin.to_host, to_host = origin.from_host, stanza = stanza}); end
end
end
if not origin.to_host then
-- Just used for friendlier logging
- origin.to_host = attr.to;
+ origin.to_host = nameprep(attr.to);
+ -- COMPAT: Fix server's chopness by not including to
+ compat_check = true;
+ end
+
+ if not origin.from_host and not origin.to_host then
+ origin.log("debug", "Improper addressing supplied, no to or from?");
+ origin:close("improper-addressing");
+ end
+ -- COMPAT: reset session.send
+ if compat_check then
+ origin.send = function(stanza) hosts[attr.to].events.fire_event("route/remote", { from_host = origin.to_host, to_host = origin.from_host, stanza = stanza}); end
end
origin.log("debug", "asking %s if key %s belongs to them", attr.from, stanza[1]);
diff --git a/plugins/muc/muc.lib.lua b/plugins/muc/muc.lib.lua
index 9be1736f..0203df26 100644
--- a/plugins/muc/muc.lib.lua
+++ b/plugins/muc/muc.lib.lua
@@ -744,7 +744,11 @@ function room_mt:handle_to_room(origin, stanza) -- presence changes and groupcha
local xmlns = stanza.tags[1] and stanza.tags[1].attr.xmlns;
if stanza.name == "iq" then
if xmlns == "http://jabber.org/protocol/disco#info" and type == "get" then
- origin.send(self:get_disco_info(stanza));
+ if stanza.tags[1].attr.node then
+ origin.send(st.error_reply(stanza, "cancel", "feature-not-implemented"));
+ else
+ origin.send(self:get_disco_info(stanza));
+ end
elseif xmlns == "http://jabber.org/protocol/disco#items" and type == "get" then
origin.send(self:get_disco_items(stanza));
elseif xmlns == "http://jabber.org/protocol/muc#admin" then