# HG changeset patch # User Waqas Hussain # Date 1280571375 -18000 # Node ID e75af8e6af542c34d242aae1632e997f7f6e0136 # Parent 53e854b52110f19f0e3ea1585d2cab2c3666ca2b mod_saslauth: Fixed a nil global access. diff -r 53e854b52110 -r e75af8e6af54 plugins/mod_saslauth.lua --- a/plugins/mod_saslauth.lua Sat Jul 31 13:55:46 2010 +0500 +++ b/plugins/mod_saslauth.lua Sat Jul 31 15:16:15 2010 +0500 @@ -113,17 +113,18 @@ 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