diff options
-rw-r--r-- | plugins/mod_saslauth.lua | 2 | ||||
-rw-r--r-- | util/sasl_cyrus.lua | 1 |
2 files changed, 3 insertions, 0 deletions
diff --git a/plugins/mod_saslauth.lua b/plugins/mod_saslauth.lua index 0f4c8b4b..0f809bd8 100644 --- a/plugins/mod_saslauth.lua +++ b/plugins/mod_saslauth.lua @@ -36,7 +36,9 @@ local xmlns_stanzas ='urn:ietf:params:xml:ns:xmpp-stanzas'; local new_sasl; if sasl_backend == "cyrus" then + prosody.unlock_globals(); local ok, cyrus = pcall(require, "util.sasl_cyrus"); + prosody.lock_globals(); if ok then local cyrus_new = cyrus.new; new_sasl = function(realm) diff --git a/util/sasl_cyrus.lua b/util/sasl_cyrus.lua index 57c6ba3c..980af598 100644 --- a/util/sasl_cyrus.lua +++ b/util/sasl_cyrus.lua @@ -87,6 +87,7 @@ end -- select a mechanism to use function method:select(mechanism) self.mechanism = mechanism; + if not self.mechs then self:mechanisms(); end return self.mechs[mechanism]; end |