mod_saslauth: "" ~= nil (thanks, Zash!)
authorPaul Aurich <paul@darkrain42.org>
Tue, 24 Jan 2012 14:57:53 -0800
changeset 4492 0a4781f165e3
parent 4491 381e0b874e6d
child 4493 cad62a675b60
mod_saslauth: "" ~= nil (thanks, Zash!)
plugins/mod_saslauth.lua
--- a/plugins/mod_saslauth.lua	Wed Jan 18 08:54:26 2012 +0500
+++ b/plugins/mod_saslauth.lua	Tue Jan 24 14:57:53 2012 -0800
@@ -191,8 +191,10 @@
 		session.from_host = text;
 	end
 	session.sends2s(build_reply("success"))
-	module:log("info", "Accepting SASL EXTERNAL identity from %s", text or session.from_host);
-	s2s_make_authenticated(session, text or session.from_host)
+
+	local domain = text ~= "" and text or session.from_host;
+	module:log("info", "Accepting SASL EXTERNAL identity from %s", domain);
+	s2s_make_authenticated(session, domain);
 	session:reset_stream();
 	return true
 end