summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--mod_auth_custom/mod_auth_custom.lua5
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");
7local pam_module = module:get_option_string("custom_pam_module", "xmpp"); 7local pam_module = module:get_option_string("custom_pam_module", "xmpp");
8local alias_file = module:get_option_string("custom_alias_file"); 8local alias_file = module:get_option_string("custom_alias_file");
9local alias_secret_file = module:get_option_string("custom_alias_secret_file"); 9local alias_secret_file = module:get_option_string("custom_alias_secret_file");
10local log_secrets = module:get_option_boolean("custom_log_secrets", false);
10 11
11function is_real_user(username) 12function 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;
40end 43end
41 44