Software / code / prosody
Comparison
util/sasl_cyrus.lua @ 2902:c405486f289c
util.sasl_cyrus: Clarify some log messages and levels
| author | Matthew Wild <mwild1@gmail.com> |
|---|---|
| date | Thu, 18 Mar 2010 10:05:35 +0000 |
| parent | 2901:5f3ccf7dd3f1 |
| child | 2903:d6da8f8e3502 |
comparison
equal
deleted
inserted
replaced
| 2901:5f3ccf7dd3f1 | 2902:c405486f289c |
|---|---|
| 37 if not initialized then | 37 if not initialized then |
| 38 local st, errmsg = pcall(cyrussasl.server_init, service_name); | 38 local st, errmsg = pcall(cyrussasl.server_init, service_name); |
| 39 if st then | 39 if st then |
| 40 initialized = true; | 40 initialized = true; |
| 41 else | 41 else |
| 42 log("error", "Failed to initialize CyrusSASL: %s", errmsg); | 42 log("error", "Failed to initialize Cyrus SASL: %s", errmsg); |
| 43 end | 43 end |
| 44 end | 44 end |
| 45 end | 45 end |
| 46 | 46 |
| 47 -- 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 |
| 55 | 55 |
| 56 local st, ret = pcall(cyrussasl.server_new, service_name, nil, realm, nil, nil) | 56 local st, ret = pcall(cyrussasl.server_new, service_name, nil, realm, nil, nil) |
| 57 if st then | 57 if st then |
| 58 sasl_i.cyrus = ret; | 58 sasl_i.cyrus = ret; |
| 59 else | 59 else |
| 60 log("error", "server_new failed: %s", ret); | 60 log("error", "Creating SASL server connection failed: %s", ret); |
| 61 return nil; | 61 return nil; |
| 62 end | 62 end |
| 63 | 63 |
| 64 if cyrussasl.set_canon_cb then | 64 if cyrussasl.set_canon_cb then |
| 65 local c14n_cb = function (user) | 65 local c14n_cb = function (user) |
| 80 return new(self.realm, self.service_name) | 80 return new(self.realm, self.service_name) |
| 81 end | 81 end |
| 82 | 82 |
| 83 -- set the forbidden mechanisms | 83 -- set the forbidden mechanisms |
| 84 function method:forbidden( restrict ) | 84 function method:forbidden( restrict ) |
| 85 log("debug", "Called method:forbidden. NOT IMPLEMENTED.") | 85 log("warn", "Called method:forbidden. NOT IMPLEMENTED.") |
| 86 return {} | 86 return {} |
| 87 end | 87 end |
| 88 | 88 |
| 89 -- get a list of possible SASL mechanims to use | 89 -- get a list of possible SASL mechanims to use |
| 90 function method:mechanisms() | 90 function method:mechanisms() |