aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--plugins/mod_saslauth.lua2
-rw-r--r--util/sasl.lua5
2 files changed, 6 insertions, 1 deletions
diff --git a/plugins/mod_saslauth.lua b/plugins/mod_saslauth.lua
index 04e33b29..9d4b27a1 100644
--- a/plugins/mod_saslauth.lua
+++ b/plugins/mod_saslauth.lua
@@ -75,7 +75,7 @@ end
local function handle_status(session, status)
if status == "failure" then
- session.sasl_handler = nil;
+ session.sasl_handler = sesion.sasl_handler:clean_clone();
elseif status == "success" then
local username = nodeprep(session.sasl_handler.username);
if not username then -- TODO move this to sessionmanager
diff --git a/util/sasl.lua b/util/sasl.lua
index 7b7db024..e3ae8087 100644
--- a/util/sasl.lua
+++ b/util/sasl.lua
@@ -90,6 +90,11 @@ function new(realm, profile, forbidden)
return s;
end
+-- get a fresh clone with the same realm, profiles and forbidden mechanisms
+function method:clean_clone()
+ return new(self.realm, self.profile, self:forbidden())
+end
+
-- set the forbidden mechanisms
function method:forbidden( restrict )
if restrict then