Diff

util/sasl_cyrus.lua @ 2392:8777831706d9

util.sasl_cyrus: Log errors if CyrusSASL init fails.
author Tobias Markmann <tm@ayena.de>
date Tue, 22 Dec 2009 20:21:44 +0100
parent 2389:8f6526da4757
child 2393:1572be348f88
line wrap: on
line diff
--- a/util/sasl_cyrus.lua	Tue Dec 22 20:20:37 2009 +0100
+++ b/util/sasl_cyrus.lua	Tue Dec 22 20:21:44 2009 +0100
@@ -49,8 +49,10 @@
 	sasl_i.realm = realm;
 	sasl_i.service_name = service_name;
 	sasl_i.cyrus = cyrussasl.server_new(service_name, realm, realm, nil, nil)
-	if sasl_i.cyrus ~= 0, 
-		   "got NULL return value from server_new")
+	if sasl_i.cyrus == 0 then
+		log("error", "got NULL return value from server_new")
+		return nil;
+	end
 	cyrussasl.setssf(sasl_i.cyrus, 0, 0xffffffff)
 	local s = setmetatable(sasl_i, method);
 	return s;