diff options
author | Kim Alvefur <zash@zash.se> | 2017-03-02 15:21:07 +0100 |
---|---|---|
committer | Kim Alvefur <zash@zash.se> | 2017-03-02 15:21:07 +0100 |
commit | 2b20da69c4cea6f2b9f94f6ba61c5ca5934bece8 (patch) | |
tree | c79d41ebf1b4a95c083a91e7f514089bc49d3823 /plugins | |
parent | 5535c0fb4808b55b86273d8dea59343d0c178441 (diff) | |
parent | f872ab669526312f0e12c4f4b44811bd45dff677 (diff) | |
download | prosody-2b20da69c4cea6f2b9f94f6ba61c5ca5934bece8.tar.gz prosody-2b20da69c4cea6f2b9f94f6ba61c5ca5934bece8.zip |
Merge 0.9->0.10
Diffstat (limited to 'plugins')
-rw-r--r-- | plugins/mod_saslauth.lua | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/plugins/mod_saslauth.lua b/plugins/mod_saslauth.lua index 68c4fe64..ee468c17 100644 --- a/plugins/mod_saslauth.lua +++ b/plugins/mod_saslauth.lua @@ -96,8 +96,19 @@ end) module:hook_stanza(xmlns_sasl, "failure", function (session, stanza) if session.type ~= "s2sout_unauthed" or session.external_auth ~= "attempting" then return; end - module:log("info", "SASL EXTERNAL with %s failed", session.to_host) - -- TODO: Log the failure reason + local text = stanza:get_child_text("text"); + local condition = "unknown-condition"; + for child in stanza:childtags() do + if child.name ~= "text" then + condition = child.name; + break; + end + end + if text and condition then + condition = connection .. ": " .. text; + end + module:log("info", "SASL EXTERNAL with %s failed: %s", session.to_host, condition); + session.external_auth = "failed" session:close(); return true; |