mod_saslauth: Don't print raw SASL data to avoid logging passwords unnecessarily
authorMatthew Wild <mwild1@gmail.com>
Sat, 13 Feb 2010 19:35:12 +0000 (19:35 +0000)
committerMatthew Wild <mwild1@gmail.com>
Sat, 13 Feb 2010 19:35:12 +0000 (19:35 +0000)
plugins/mod_saslauth.lua

index beb59dd2b8cb6e1a17aeb4bd946cf6a0b71ee2cc..be324b24e4a557c3a59d544e2286d5408be0ccee 100644 (file)
@@ -69,13 +69,13 @@ local anonymous_authentication_profile = {
 local function build_reply(status, ret, err_msg)
        local reply = st.stanza(status, {xmlns = xmlns_sasl});
        if status == "challenge" then
-               log("debug", "%s", ret or "");
+               --log("debug", "CHALLENGE: %s", ret or "");
                reply:text(base64.encode(ret or ""));
        elseif status == "failure" then
                reply:tag(ret):up();
                if err_msg then reply:tag("text"):text(err_msg); end
        elseif status == "success" then
-               log("debug", "%s", ret or "");
+               --log("debug", "SUCCESS: %s", ret or "");
                reply:text(base64.encode(ret or ""));
        else
                module:log("error", "Unknown sasl status: %s", status);
@@ -123,7 +123,7 @@ local function sasl_handler(session, stanza)
        local text = stanza[1];
        if text then
                text = base64.decode(text);
-               log("debug", "%s", text:gsub("[%z\001-\008\011\012\014-\031]", " "));
+               --log("debug", "AUTH: %s", text:gsub("[%z\001-\008\011\012\014-\031]", " "));
                if not text then
                        session.sasl_handler = nil;
                        session.send(build_reply("failure", "incorrect-encoding"));