mod_posix: Remove the lines added to work around the util.signal loop bug
[prosody.git] / util / sasl_cyrus.lua
index fd192233d6ed1742255f5e25098c8abf5ce0c3b6..b42bee07e1860f89f95508bd14665a68a0b21cc2 100644 (file)
@@ -35,8 +35,11 @@ local initialized = false;
 
 local function init(service_name)
        if not initialized then
-               if pcall(cyrussasl.server_init, service_name) then
+               local st, errmsg = pcall(cyrussasl.server_init, service_name);
+               if st then
                        initialized = true;
+               else
+                       log("error", "Failed to initialize CyrusSASL: %s", errmsg);
                end
        end
 end
@@ -44,9 +47,9 @@ end
 -- create a new SASL object which can be used to authenticate clients
 function new(realm, service_name)
        local sasl_i = {};
-       
+
        init(service_name);
-       
+
        sasl_i.realm = realm;
        sasl_i.service_name = service_name;
        sasl_i.cyrus = cyrussasl.server_new(service_name, nil, nil, nil, nil)