aboutsummaryrefslogtreecommitdiffstats
path: root/core/stanza_router.lua
diff options
context:
space:
mode:
authorMatthew Wild <mwild1@gmail.com>2008-10-08 17:27:20 +0100
committerMatthew Wild <mwild1@gmail.com>2008-10-08 17:27:20 +0100
commit584b40a6825647ae2388ba47247689e8994c2129 (patch)
tree77a86a2fb4ee9e93acfbbbe81537eefb57a01144 /core/stanza_router.lua
parent37890122d6cd3b5ad419560b06bad2b69b9a5577 (diff)
parent0af37d5e1ed0b11e90e63ff232557dc890504a6f (diff)
downloadprosody-584b40a6825647ae2388ba47247689e8994c2129.tar.gz
prosody-584b40a6825647ae2388ba47247689e8994c2129.zip
Merge roster fixes from waqas
Diffstat (limited to 'core/stanza_router.lua')
-rw-r--r--core/stanza_router.lua7
1 files changed, 7 insertions, 0 deletions
diff --git a/core/stanza_router.lua b/core/stanza_router.lua
index e5603cae..02e0871f 100644
--- a/core/stanza_router.lua
+++ b/core/stanza_router.lua
@@ -16,6 +16,13 @@ local jid_split = jid.split;
function core_process_stanza(origin, stanza)
log("debug", "Received: "..tostring(stanza))
-- TODO verify validity of stanza (as well as JID validity)
+
+ if origin.type == "c2s" and not origin.full_jid
+ and not(stanza.name == "iq" and stanza.tags[1] and stanza.tags[1].name == "bind"
+ and stanza.tags[1].attr.xmlns == "urn:ietf:params:xml:ns:xmpp-bind") then
+ error("Client MUST bind resource after auth");
+ end
+
local to = stanza.attr.to;
stanza.attr.from = origin.full_jid -- quick fix to prevent impersonation