Comparison

plugins/mod_saslauth.lua @ 1186:078eb3b109e9

mod_saslauth: Fix logic error which prevented SASL ANONYMOUS from working
author Matthew Wild <mwild1@gmail.com>
date Mon, 18 May 2009 04:48:35 +0100
parent 1073:7c20373d4451
child 1216:fd8ce71bc72b
comparison
equal deleted inserted replaced
1143:5bab3eb566ad 1186:078eb3b109e9
77 end 77 end
78 78
79 local function sasl_handler(session, stanza) 79 local function sasl_handler(session, stanza)
80 if stanza.name == "auth" then 80 if stanza.name == "auth" then
81 -- FIXME ignoring duplicates because ejabberd does 81 -- FIXME ignoring duplicates because ejabberd does
82 if config.get(session.host or "*", "core", "anonymous_login") and stanza.attr.mechanism ~= "ANONYMOUS" then 82 if config.get(session.host or "*", "core", "anonymous_login") then
83 return session.send(build_reply("failure", "invalid-mechanism")); 83 if stanza.attr.mechanism ~= "ANONYMOUS" then
84 return session.send(build_reply("failure", "invalid-mechanism"));
85 end
84 elseif stanza.attr.mechanism == "ANONYMOUS" then 86 elseif stanza.attr.mechanism == "ANONYMOUS" then
85 return session.send(build_reply("failure", "mechanism-too-weak")); 87 return session.send(build_reply("failure", "mechanism-too-weak"));
86 end 88 end
87 session.sasl_handler = new_sasl(stanza.attr.mechanism, session.host, password_callback); 89 session.sasl_handler = new_sasl(stanza.attr.mechanism, session.host, password_callback);
88 if not session.sasl_handler then 90 if not session.sasl_handler then