diff options
author | Matthew Wild <mwild1@gmail.com> | 2010-07-04 19:16:20 +0100 |
---|---|---|
committer | Matthew Wild <mwild1@gmail.com> | 2010-07-04 19:16:20 +0100 |
commit | 1e6c27f39824c7dce4f3b1e4cffa46f192ed5474 (patch) | |
tree | 1b08dac49c9e0716ebf446b0f93571187a7e2715 /net | |
parent | 9ca26d127bac2f41f480305a3f8d4ad5b2a895a0 (diff) | |
download | prosody-1e6c27f39824c7dce4f3b1e4cffa46f192ed5474.tar.gz prosody-1e6c27f39824c7dce4f3b1e4cffa46f192ed5474.zip |
xmppcomponent_listener: Add log messages for when stanzas from components have invalid or missing to/from addresses
Diffstat (limited to 'net')
-rw-r--r-- | net/xmppcomponent_listener.lua | 2 |
1 files changed, 2 insertions, 0 deletions
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 |