diff options
Diffstat (limited to 'mod_auth_custom/mod_auth_custom.lua')
-rw-r--r-- | mod_auth_custom/mod_auth_custom.lua | 9 |
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) | |||
16 | end | 16 | end |
17 | 17 | ||
18 | function test_password(username, password) | 18 | function 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 |