mod_saslauth: Fix logic error which prevented SASL ANONYMOUS from working

Mon, 18 May 2009 04:48:35 +0100

author
Matthew Wild <mwild1@gmail.com>
date
Mon, 18 May 2009 04:48:35 +0100
changeset 1186
078eb3b109e9
parent 1143
5bab3eb566ad
child 1187
645846375a7b
child 1190
fff8158faae2

mod_saslauth: Fix logic error which prevented SASL ANONYMOUS from working

plugins/mod_saslauth.lua file | annotate | diff | comparison | revisions
--- a/plugins/mod_saslauth.lua	Wed May 13 16:54:46 2009 +0100
+++ b/plugins/mod_saslauth.lua	Mon May 18 04:48:35 2009 +0100
@@ -79,8 +79,10 @@
 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

mercurial