aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorWaqas Hussain <waqas20@gmail.com>2010-11-02 15:07:25 +0500
committerWaqas Hussain <waqas20@gmail.com>2010-11-02 15:07:25 +0500
commit42756c02be58eeaae3cf55c99b1b1d8604a57ba9 (patch)
treecb6ee88418c784f06fd7169c385abc5520a49dd6
parent86a10741089db5350ca045ff3057024d170032f7 (diff)
downloadprosody-42756c02be58eeaae3cf55c99b1b1d8604a57ba9.tar.gz
prosody-42756c02be58eeaae3cf55c99b1b1d8604a57ba9.zip
mod_saslauth: Handle SASL <abort/> properly.
-rw-r--r--plugins/mod_saslauth.lua7
1 files changed, 6 insertions, 1 deletions
diff --git a/plugins/mod_saslauth.lua b/plugins/mod_saslauth.lua
index 94dc8808..85f7fcbf 100644
--- a/plugins/mod_saslauth.lua
+++ b/plugins/mod_saslauth.lua
@@ -119,8 +119,13 @@ local function sasl_handler(event)
end
module:hook("stanza/urn:ietf:params:xml:ns:xmpp-sasl:auth", sasl_handler);
-module:hook("stanza/urn:ietf:params:xml:ns:xmpp-sasl:abort", sasl_handler);
module:hook("stanza/urn:ietf:params:xml:ns:xmpp-sasl:response", sasl_handler);
+module:hook("stanza/urn:ietf:params:xml:ns:xmpp-sasl:abort", function(event)
+ local session = event.origin;
+ session.sasl_handler = nil;
+ session.send(build_reply("failure", "aborted"));
+ return true;
+end);
local mechanisms_attr = { xmlns='urn:ietf:params:xml:ns:xmpp-sasl' };
local bind_attr = { xmlns='urn:ietf:params:xml:ns:xmpp-bind' };