mod_saslauth: Fix logic error which prevented SASL ANONYMOUS from working

This commit is contained in:
Matthew Wild 2009-05-18 04:48:35 +01:00
parent 482dc64bc9
commit 4c6d6e419f

View file

@ -79,8 +79,10 @@ end
local function sasl_handler(session, stanza)
if stanza.name == "auth" then
-- FIXME ignoring duplicates because ejabberd does
if config.get(session.host or "*", "core", "anonymous_login") and stanza.attr.mechanism ~= "ANONYMOUS" then
return session.send(build_reply("failure", "invalid-mechanism"));
if config.get(session.host or "*", "core", "anonymous_login") then
if stanza.attr.mechanism ~= "ANONYMOUS" then
return session.send(build_reply("failure", "invalid-mechanism"));
end
elseif stanza.attr.mechanism == "ANONYMOUS" then
return session.send(build_reply("failure", "mechanism-too-weak"));
end