aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorWaqas Hussain <waqas20@gmail.com>2010-07-31 15:16:15 +0500
committerWaqas Hussain <waqas20@gmail.com>2010-07-31 15:16:15 +0500
commit29db7ce7a6ea531be98eeadda520d1ebd6e2d38b (patch)
treedb595a8a59019265f56762bbd7b3580b82dfa424
parent0479f87585099747b3c14fd5a0e91889868790d0 (diff)
downloadprosody-29db7ce7a6ea531be98eeadda520d1ebd6e2d38b.tar.gz
prosody-29db7ce7a6ea531be98eeadda520d1ebd6e2d38b.zip
mod_saslauth: Fixed a nil global access.
-rw-r--r--plugins/mod_saslauth.lua7
1 files changed, 4 insertions, 3 deletions
diff --git a/plugins/mod_saslauth.lua b/plugins/mod_saslauth.lua
index fac58db6..a6f92024 100644
--- a/plugins/mod_saslauth.lua
+++ b/plugins/mod_saslauth.lua
@@ -113,17 +113,18 @@ end
local function sasl_handler(session, stanza)
if stanza.name == "auth" then
-- FIXME ignoring duplicates because ejabberd does
+ local mechanism = stanza.attr.mechanism;
if anonymous_login then
- if stanza.attr.mechanism ~= "ANONYMOUS" then
+ if mechanism ~= "ANONYMOUS" then
return session.send(build_reply("failure", "invalid-mechanism"));
end
- elseif stanza.attr.mechanism == "ANONYMOUS" then
+ elseif mechanism == "ANONYMOUS" then
return session.send(build_reply("failure", "mechanism-too-weak"));
end
if not session.secure and (secure_auth_only or (mechanism == "PLAIN" and not allow_unencrypted_plain_auth)) then
return session.send(build_reply("failure", "encryption-required"));
end
- local valid_mechanism = session.sasl_handler:select(stanza.attr.mechanism);
+ local valid_mechanism = session.sasl_handler:select(mechanism);
if not valid_mechanism then
return session.send(build_reply("failure", "invalid-mechanism"));
end