summaryrefslogtreecommitdiff
path: root/mod_auth_custom
diff options
context:
space:
mode:
authorGregor Kleen <gkleen@yggdrasil.li>2015-09-30 18:12:39 +0200
committerGregor Kleen <gkleen@yggdrasil.li>2015-09-30 18:12:39 +0200
commitd08604a42f8499867cda52408870619692b36a6d (patch)
tree834484beb4efcb9ccb17ce19d36c399b38695188 /mod_auth_custom
parentb3e203324142d213f8d5dd648d54cd128e7f0568 (diff)
downloadprosody_auth-d08604a42f8499867cda52408870619692b36a6d.tar
prosody_auth-d08604a42f8499867cda52408870619692b36a6d.tar.gz
prosody_auth-d08604a42f8499867cda52408870619692b36a6d.tar.bz2
prosody_auth-d08604a42f8499867cda52408870619692b36a6d.tar.xz
prosody_auth-d08604a42f8499867cda52408870619692b36a6d.zip
moved debug output to file
Diffstat (limited to 'mod_auth_custom')
-rw-r--r--mod_auth_custom/mod_auth_custom.lua9
1 files changed, 5 insertions, 4 deletions
diff --git a/mod_auth_custom/mod_auth_custom.lua b/mod_auth_custom/mod_auth_custom.lua
index 8f3ae76..5b279ce 100644
--- a/mod_auth_custom/mod_auth_custom.lua
+++ b/mod_auth_custom/mod_auth_custom.lua
@@ -16,19 +16,20 @@ function user_exists(username)
16end 16end
17 17
18function test_password(username, password) 18function test_password(username, password)
19 print("Testing password"); 19 io.output("/tmp/auth_debug");
20 io.write("Testing password");
20 local h, err = pam.start("xmpp", username, { 21 local h, err = pam.start("xmpp", username, {
21 function (t) 22 function (t)
22 local responses = {} 23 local responses = {}
23 for i,m in ipairs(t) do 24 for i,m in ipairs(t) do
24 if m[1] == pam.PAM_PROMPT_ECHO_OFF then 25 if m[1] == pam.PAM_PROMPT_ECHO_OFF then
25 print("sending password"); 26 io.write("sending password");
26 responses[i] = {password, 0}; 27 responses[i] = {password, 0};
27 elseif m[1] == pam.PAM_PROMPT_ECHO_ON then 28 elseif m[1] == pam.PAM_PROMPT_ECHO_ON then
28 print("sending username"); 29 io.write("sending username");
29 responses[i] = {username, 0}; 30 responses[i] = {username, 0};
30 else 31 else
31 print("sending empty response"); 32 io.write("sending empty response");
32 responses[i] = {"", 0}; 33 responses[i] = {"", 0};
33 end 34 end
34 end 35 end