Software /
code /
prosody
Changeset
2927:c041495f0546
mod_saslauth: Fail with an error when the requested SASL backend cannot be used.
author | Waqas Hussain <waqas20@gmail.com> |
---|---|
date | Tue, 23 Mar 2010 20:11:39 +0500 |
parents | 2925:692b3c6c5bd2 |
children | 2928:e6380fcaffda |
files | plugins/mod_saslauth.lua |
diffstat | 1 files changed, 6 insertions(+), 4 deletions(-) [+] |
line wrap: on
line diff
--- a/plugins/mod_saslauth.lua Mon Mar 22 17:24:55 2010 +0000 +++ b/plugins/mod_saslauth.lua Tue Mar 23 20:11:39 2010 +0500 @@ -46,13 +46,15 @@ return cyrus_new(realm, module:get_option("cyrus_service_name") or "xmpp"); end else - sasl_backend = "builtin"; - module:log("warn", "Failed to load Cyrus SASL, falling back to builtin auth mechanisms"); - module:log("debug", "Failed to load Cyrus because: %s", cyrus); + module:log("error", "Failed to load Cyrus SASL because: %s", cyrus); + error("Failed to load Cyrus SASL"); end end if not new_sasl then - if sasl_backend ~= "builtin" then module:log("warn", "Unknown SASL backend %s", sasl_backend); end; + if sasl_backend ~= "builtin" then + module:log("error", "Unknown SASL backend: %s", sasl_backend); + error("Unknown SASL backend"); + end new_sasl = require "util.sasl".new; end