Diff

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
line wrap: on
line diff
--- 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