mirror of
https://github.com/bjc/prosody.git
synced 2025-04-07 07:07:38 +03:00
mod_saslauth: Tidier code for SASL backend selection.
This commit is contained in:
parent
e0f77c120d
commit
155c497847
1 changed files with 6 additions and 8 deletions
|
@ -35,7 +35,9 @@ local xmlns_bind ='urn:ietf:params:xml:ns:xmpp-bind';
|
||||||
local xmlns_stanzas ='urn:ietf:params:xml:ns:xmpp-stanzas';
|
local xmlns_stanzas ='urn:ietf:params:xml:ns:xmpp-stanzas';
|
||||||
|
|
||||||
local new_sasl;
|
local new_sasl;
|
||||||
if sasl_backend == "cyrus" then
|
if sasl_backend == "builtin" then
|
||||||
|
new_sasl = require "util.sasl".new;
|
||||||
|
elseif sasl_backend == "cyrus" then
|
||||||
prosody.unlock_globals(); --FIXME: Figure out why this is needed and
|
prosody.unlock_globals(); --FIXME: Figure out why this is needed and
|
||||||
-- why cyrussasl isn't caught by the sandbox
|
-- why cyrussasl isn't caught by the sandbox
|
||||||
local ok, cyrus = pcall(require, "util.sasl_cyrus");
|
local ok, cyrus = pcall(require, "util.sasl_cyrus");
|
||||||
|
@ -49,13 +51,9 @@ if sasl_backend == "cyrus" then
|
||||||
module:log("error", "Failed to load Cyrus SASL because: %s", cyrus);
|
module:log("error", "Failed to load Cyrus SASL because: %s", cyrus);
|
||||||
error("Failed to load Cyrus SASL");
|
error("Failed to load Cyrus SASL");
|
||||||
end
|
end
|
||||||
end
|
else
|
||||||
if not new_sasl then
|
|
||||||
if sasl_backend ~= "builtin" then
|
|
||||||
module:log("error", "Unknown SASL backend: %s", sasl_backend);
|
module:log("error", "Unknown SASL backend: %s", sasl_backend);
|
||||||
error("Unknown SASL backend");
|
error("Unknown SASL backend");
|
||||||
end
|
|
||||||
new_sasl = require "util.sasl".new;
|
|
||||||
end
|
end
|
||||||
|
|
||||||
local default_authentication_profile = {
|
local default_authentication_profile = {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue