# HG changeset patch # User Matthew Wild # Date 1278267380 -3600 # Node ID dcdfc04f9e3aaf559ff7fe94b2e3372734a645b7 # Parent 517ae40a12a2d39da2e5c11e185aa76460b8eb76 xmppcomponent_listener: Add log messages for when stanzas from components have invalid or missing to/from addresses diff -r 517ae40a12a2 -r dcdfc04f9e3a net/xmppcomponent_listener.lua --- a/net/xmppcomponent_listener.lua Sun Jul 04 19:15:20 2010 +0100 +++ b/net/xmppcomponent_listener.lua Sun Jul 04 19:16:20 2010 +0100 @@ -107,6 +107,7 @@ 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 @@ 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