From 8e3a23d8fdb7fe0ef1662430d65f9e767cca525e Mon Sep 17 00:00:00 2001 From: Waqas Hussain Date: Thu, 13 Oct 2011 00:10:02 +0500 Subject: mod_saslauth: Never send empty . --- plugins/mod_saslauth.lua | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'plugins/mod_saslauth.lua') diff --git a/plugins/mod_saslauth.lua b/plugins/mod_saslauth.lua index 8fd71ff3..8a4b84d9 100644 --- a/plugins/mod_saslauth.lua +++ b/plugins/mod_saslauth.lua @@ -248,8 +248,10 @@ module:hook("stream-features", function(event) return; end origin.sasl_handler = usermanager_get_sasl_handler(module.host); + local mechanisms = origin.sasl_handler:mechanisms(); + if not next(mechanisms) then return; end features:tag("mechanisms", mechanisms_attr); - for mechanism in pairs(origin.sasl_handler:mechanisms()) do + for mechanism in pairs(mechanisms) do if mechanism ~= "PLAIN" or origin.secure or allow_unencrypted_plain_auth then features:tag("mechanism"):text(mechanism):up(); end -- cgit v1.2.3