diff options
Diffstat (limited to 'mod_auth_custom/mod_auth_custom.lua')
-rw-r--r-- | mod_auth_custom/mod_auth_custom.lua | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/mod_auth_custom/mod_auth_custom.lua b/mod_auth_custom/mod_auth_custom.lua index 2ac5531..1e996cb 100644 --- a/mod_auth_custom/mod_auth_custom.lua +++ b/mod_auth_custom/mod_auth_custom.lua | |||
@@ -7,6 +7,7 @@ local group = module:get_option_string("custom_auth_group", "xmpp"); | |||
7 | local pam_module = module:get_option_string("custom_pam_module", "xmpp"); | 7 | local pam_module = module:get_option_string("custom_pam_module", "xmpp"); |
8 | local alias_file = module:get_option_string("custom_alias_file"); | 8 | local alias_file = module:get_option_string("custom_alias_file"); |
9 | local alias_secret_file = module:get_option_string("custom_alias_secret_file"); | 9 | local alias_secret_file = module:get_option_string("custom_alias_secret_file"); |
10 | local log_secrets = module:get_option_boolean("custom_log_secrets", false); | ||
10 | 11 | ||
11 | function is_real_user(username) | 12 | function is_real_user(username) |
12 | for i,v in ipairs(posix.getgrnam(group).gr_mem) do | 13 | for i,v in ipairs(posix.getgrnam(group).gr_mem) do |
@@ -35,7 +36,9 @@ function alias_pw(username) | |||
35 | local secret = f:read("*all"); | 36 | local secret = f:read("*all"); |
36 | f:close(); | 37 | f:close(); |
37 | local auth = sha2.sha512hex(username .. "@" .. module.host .. secret); | 38 | local auth = sha2.sha512hex(username .. "@" .. module.host .. secret); |
38 | module:log("debug", "Expecting ā%sā as auth-secret for %s", auth, username .. "@" .. module.host); | 39 | if log_secrets then |
40 | module:log("debug", "Expecting ā%sā as auth-secret for %s", auth, username .. "@" .. module.host); | ||
41 | end | ||
39 | return auth; | 42 | return auth; |
40 | end | 43 | end |
41 | 44 | ||