mod_saslauth: Fail with an error when the requested SASL backend cannot be used.

Tue, 23 Mar 2010 20:11:39 +0500

author
Waqas Hussain <waqas20@gmail.com>
date
Tue, 23 Mar 2010 20:11:39 +0500
changeset 2927
c041495f0546
parent 2925
692b3c6c5bd2
child 2928
e6380fcaffda

mod_saslauth: Fail with an error when the requested SASL backend cannot be used.

plugins/mod_saslauth.lua file | annotate | diff | comparison | revisions
--- 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
 

mercurial