From 1e6c27f39824c7dce4f3b1e4cffa46f192ed5474 Mon Sep 17 00:00:00 2001 From: Matthew Wild Date: Sun, 4 Jul 2010 19:16:20 +0100 Subject: xmppcomponent_listener: Add log messages for when stanzas from components have invalid or missing to/from addresses --- net/xmppcomponent_listener.lua | 2 ++ 1 file changed, 2 insertions(+) diff --git a/net/xmppcomponent_listener.lua b/net/xmppcomponent_listener.lua index de1dca45..5532186b 100644 --- a/net/xmppcomponent_listener.lua +++ b/net/xmppcomponent_listener.lua @@ -107,6 +107,7 @@ function stream_callbacks.handlestanza(session, stanza) local _, domain = jid_split(stanza.attr.from); if domain ~= session.host then -- Return error + session.log("warn", "Component sent stanza with missing or invalid 'from' address"); session:close{ condition = "invalid-from"; text = "Component tried to send from address <"..tostring(from) @@ -119,6 +120,7 @@ function stream_callbacks.handlestanza(session, stanza) stanza.attr.from = session.host; end if not stanza.attr.to then + session.log("warn", "Rejecting stanza with no 'to' address"); session.send(st.error_reply(stanza, "modify", "bad-request", "Components MUST specify a 'to' address on stanzas")); return; end -- cgit v1.2.3