mod_saslauth: Fixed access of globals.
authorWaqas Hussain <waqas20@gmail.com>
Sun, 18 Oct 2009 13:50:35 +0000 (18:50 +0500)
committerWaqas Hussain <waqas20@gmail.com>
Sun, 18 Oct 2009 13:50:35 +0000 (18:50 +0500)
plugins/mod_saslauth.lua

index ac705ca39b9ea487c8bccc0c470fee0d50c23c6e..c0f57cd7158d71df7561b37778fda114806abad3 100644 (file)
@@ -83,7 +83,7 @@ local function credentials_callback(mechanism, ...)
                        return response;
                end
        elseif mechanism == "DIGEST-MD5" then
-               function func(x) return x; end
+               local function func(x) return x; end
                local node, domain, realm, decoder = ...;
                local prepped_node = nodeprep(node);
                if not prepped_node then
@@ -153,7 +153,7 @@ module:add_event_hook("stream-features",
                                        if config.get(session.host or "*", "core", "anonymous_login") then
                                                features:tag("mechanism"):text("ANONYMOUS"):up();
                                        else
-                                               mechanisms = usermanager_get_supported_methods(session.host or "*");
+                                               local mechanisms = usermanager_get_supported_methods(session.host or "*");
                                                for k, v in pairs(mechanisms) do
                                                        features:tag("mechanism"):text(k):up();
                                                end