diff options
author | Waqas Hussain <waqas20@gmail.com> | 2011-10-13 00:10:02 +0500 |
---|---|---|
committer | Waqas Hussain <waqas20@gmail.com> | 2011-10-13 00:10:02 +0500 |
commit | 90a5f85bf3165f6a736e9109c83c90ed470070f5 (patch) | |
tree | 189d11779bc293987361fe5558f89fa03da5614c /plugins | |
parent | cf01eb36325a76436a39e14b6505f9e850fdf4f5 (diff) | |
download | prosody-90a5f85bf3165f6a736e9109c83c90ed470070f5.tar.gz prosody-90a5f85bf3165f6a736e9109c83c90ed470070f5.zip |
mod_saslauth: Never send empty <mechanisms/>.
Diffstat (limited to 'plugins')
-rw-r--r-- | plugins/mod_saslauth.lua | 4 |
1 files changed, 3 insertions, 1 deletions
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 |