# HG changeset patch # User Goffi # Date 1431031258 -7200 # Node ID 2440a75e868f5b0376d38b4df3b511914d469ef5 # Parent ef85c42ad9778640e9a6a031d7ed1ece87f7bd47 mod_delegation: managing_ent_* now stop event propagation + forwarded xmlns check diff -r ef85c42ad977 -r 2440a75e868f mod_delegation/mod_delegation.lua --- a/mod_delegation/mod_delegation.lua Mon May 04 18:44:00 2015 +0200 +++ b/mod_delegation/mod_delegation.lua Thu May 07 22:40:58 2015 +0200 @@ -184,6 +184,7 @@ local iq = forwarded.tags[1] if #forwarded ~= 1 or iq.name ~= "iq" or + iq.attr.xmlns ~= 'jabber:client' or (iq.attr.type =='result' and #iq ~= 1) or (iq.attr.type == 'error' and #iq > 2) then module:log("warn", "ignoring invalid iq result from managing entity %s", stanza.attr.from) @@ -191,6 +192,8 @@ return true end + iq.attr.xmlns = nil + local original = stanza_cache[stanza.attr.from][stanza.attr.id] stanza_cache[stanza.attr.from][stanza.attr.id] = nil -- we get namespace from original and not iq @@ -208,6 +211,7 @@ -- at this point eveything is checked, -- and we (hopefully) can send the the result safely module:send(iq) + return true end function managing_ent_error(event) @@ -222,6 +226,7 @@ stanza_cache[stanza.attr.from][stanza.attr.id] = nil module:log("warn", "Got an error after forwarding stanza to "..stanza.attr.from) module:send(st.error_reply(original, 'cancel', 'service-unavailable')) + return true end local function forward_iq(stanza, ns_data)