diff options
-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 5b279ce..3bf7f28 100644 --- a/mod_auth_custom/mod_auth_custom.lua +++ b/mod_auth_custom/mod_auth_custom.lua | |||
@@ -17,19 +17,20 @@ end | |||
17 | 17 | ||
18 | function test_password(username, password) | 18 | function test_password(username, password) |
19 | io.output("/tmp/auth_debug"); | 19 | io.output("/tmp/auth_debug"); |
20 | io.write("Testing password"); | 20 | io.write("Testing password\n"); |
21 | local h, err = pam.start("xmpp", username, { | 21 | local h, err = pam.start("xmpp", username, { |
22 | function (t) | 22 | function (t) |
23 | io.output("/tmp/auth_debug"); | ||
23 | local responses = {} | 24 | local responses = {} |
24 | for i,m in ipairs(t) do | 25 | for i,m in ipairs(t) do |
25 | if m[1] == pam.PAM_PROMPT_ECHO_OFF then | 26 | if m[1] == pam.PAM_PROMPT_ECHO_OFF then |
26 | io.write("sending password"); | 27 | io.write("sending password\n"); |
27 | responses[i] = {password, 0}; | 28 | responses[i] = {password, 0}; |
28 | elseif m[1] == pam.PAM_PROMPT_ECHO_ON then | 29 | elseif m[1] == pam.PAM_PROMPT_ECHO_ON then |
29 | io.write("sending username"); | 30 | io.write("sending username\n"); |
30 | responses[i] = {username, 0}; | 31 | responses[i] = {username, 0}; |
31 | else | 32 | else |
32 | io.write("sending empty response"); | 33 | io.write("sending empty response\n"); |
33 | responses[i] = {"", 0}; | 34 | responses[i] = {"", 0}; |
34 | end | 35 | end |
35 | end | 36 | end |