diff options
-rw-r--r-- | mod_auth_custom/mod_auth_custom.lua | 8 |
1 files changed, 0 insertions, 8 deletions
diff --git a/mod_auth_custom/mod_auth_custom.lua b/mod_auth_custom/mod_auth_custom.lua index d48f4eb..fc8d0c8 100644 --- a/mod_auth_custom/mod_auth_custom.lua +++ b/mod_auth_custom/mod_auth_custom.lua | |||
@@ -16,26 +16,18 @@ function user_exists(username) | |||
16 | end | 16 | end |
17 | 17 | ||
18 | function test_password(username, password) | 18 | function test_password(username, password) |
19 | local f = io.open("/tmp/auth_debug", "a"); | ||
20 | f:write("Testing password\n"); | ||
21 | f:close(); | ||
22 | local h, err = pam.start("xmpp", username, { | 19 | local h, err = pam.start("xmpp", username, { |
23 | function (t) | 20 | function (t) |
24 | local f = io.open("/tmp/auth_debug", "a"); | ||
25 | local responses = {} | 21 | local responses = {} |
26 | for i,m in ipairs(t) do | 22 | for i,m in ipairs(t) do |
27 | if m[1] == pam.PROMPT_ECHO_OFF then | 23 | if m[1] == pam.PROMPT_ECHO_OFF then |
28 | f:write("sending password\n"); | ||
29 | responses[i] = {password, 0}; | 24 | responses[i] = {password, 0}; |
30 | elseif m[1] == pam.PROMPT_ECHO_ON then | 25 | elseif m[1] == pam.PROMPT_ECHO_ON then |
31 | f:write("sending username\n"); | ||
32 | responses[i] = {username, 0}; | 26 | responses[i] = {username, 0}; |
33 | else | 27 | else |
34 | f:write("sending empty response\n"); | ||
35 | responses[i] = {"", 0}; | 28 | responses[i] = {"", 0}; |
36 | end | 29 | end |
37 | end | 30 | end |
38 | f:close() | ||
39 | return responses | 31 | return responses |
40 | end | 32 | end |
41 | }); | 33 | }); |