Comparison

util/sasl_cyrus.lua @ 2404:d7abdd6893b8

util.sasl_cyrus: Report an error if Cyrus SASL init fails.
author Tobias Markmann <tm@ayena.de>
date Wed, 30 Dec 2009 16:43:08 +0100
parent 2403:916482cdfb74
child 2577:acb382c703e4
comparison
equal deleted inserted replaced
2403:916482cdfb74 2404:d7abdd6893b8
33 method.__index = method; 33 method.__index = method;
34 local initialized = false; 34 local initialized = false;
35 35
36 local function init(service_name) 36 local function init(service_name)
37 if not initialized then 37 if not initialized then
38 if pcall(cyrussasl.server_init, service_name) then 38 local st, errmsg = pcall(cyrussasl.server_init, service_name);
39 if st then
39 initialized = true; 40 initialized = true;
41 else
42 log("error", "Failed to initialize CyrusSASL: %s", errmsg);
40 end 43 end
41 end 44 end
42 end 45 end
43 46
44 -- create a new SASL object which can be used to authenticate clients 47 -- create a new SASL object which can be used to authenticate clients