Software / code / prosody
Comparison
plugins/mod_saslauth.lua @ 2927:c041495f0546
mod_saslauth: Fail with an error when the requested SASL backend cannot be used.
| author | Waqas Hussain <waqas20@gmail.com> |
|---|---|
| date | Tue, 23 Mar 2010 20:11:39 +0500 |
| parent | 2925:692b3c6c5bd2 |
| child | 2928:e6380fcaffda |
comparison
equal
deleted
inserted
replaced
| 2925:692b3c6c5bd2 | 2927:c041495f0546 |
|---|---|
| 44 local cyrus_new = cyrus.new; | 44 local cyrus_new = cyrus.new; |
| 45 new_sasl = function(realm) | 45 new_sasl = function(realm) |
| 46 return cyrus_new(realm, module:get_option("cyrus_service_name") or "xmpp"); | 46 return cyrus_new(realm, module:get_option("cyrus_service_name") or "xmpp"); |
| 47 end | 47 end |
| 48 else | 48 else |
| 49 sasl_backend = "builtin"; | 49 module:log("error", "Failed to load Cyrus SASL because: %s", cyrus); |
| 50 module:log("warn", "Failed to load Cyrus SASL, falling back to builtin auth mechanisms"); | 50 error("Failed to load Cyrus SASL"); |
| 51 module:log("debug", "Failed to load Cyrus because: %s", cyrus); | |
| 52 end | 51 end |
| 53 end | 52 end |
| 54 if not new_sasl then | 53 if not new_sasl then |
| 55 if sasl_backend ~= "builtin" then module:log("warn", "Unknown SASL backend %s", sasl_backend); end; | 54 if sasl_backend ~= "builtin" then |
| 55 module:log("error", "Unknown SASL backend: %s", sasl_backend); | |
| 56 error("Unknown SASL backend"); | |
| 57 end | |
| 56 new_sasl = require "util.sasl".new; | 58 new_sasl = require "util.sasl".new; |
| 57 end | 59 end |
| 58 | 60 |
| 59 local default_authentication_profile = { | 61 local default_authentication_profile = { |
| 60 plain = function(username, realm) | 62 plain = function(username, realm) |