Changeset

4841:ce793cea9f10

Merge with backout
author Matthew Wild <mwild1@gmail.com>
date Fri, 11 May 2012 01:32:46 +0100
parents 4839:4905aed00382 (diff) 4840:82679fad3a36 (current diff)
children 4843:d91dda67647a
files plugins/mod_dialback.lua
diffstat 3 files changed, 20 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/plugins/mod_auth_anonymous.lua	Fri May 11 01:29:30 2012 +0100
+++ b/plugins/mod_auth_anonymous.lua	Fri May 11 01:32:46 2012 +0100
@@ -52,6 +52,7 @@
 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);
--- a/plugins/mod_dialback.lua	Fri May 11 01:29:30 2012 +0100
+++ b/plugins/mod_dialback.lua	Fri May 11 01:32:46 2012 +0100
@@ -15,6 +15,7 @@
 
 local st = require "util.stanza";
 local sha256_hash = require "util.hashes".sha256;
+local nameprep = require "util.encodings".stringprep.nameprep;
 
 local xmlns_stream = "http://etherx.jabber.org/streams";
 
@@ -75,13 +76,25 @@
 		
 		dialback_requests[attr.from.."/"..origin.streamid] = origin;
 		
+		local compat_check;
 		if not origin.from_host then
 			-- Just used for friendlier logging
 			origin.from_host = attr.from;
 		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]);
--- a/plugins/muc/muc.lib.lua	Fri May 11 01:29:30 2012 +0100
+++ b/plugins/muc/muc.lib.lua	Fri May 11 01:32:46 2012 +0100
@@ -744,7 +744,11 @@
 	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