diff options
author | Gregor Kleen <gkleen@yggdrasil.li> | 2018-04-21 17:22:43 +0200 |
---|---|---|
committer | Gregor Kleen <gkleen@yggdrasil.li> | 2018-04-21 17:22:43 +0200 |
commit | a321ab25719582c699353b2ffeca8e04cada8fbc (patch) | |
tree | 8c204a94a1f95c80ed0bf9a8c0571b4353549bc0 /mod_auth_custom | |
parent | cb3ca4eac2a3bf2f589584278c1776db2da3a3f6 (diff) | |
download | prosody_auth-master.tar prosody_auth-master.tar.gz prosody_auth-master.tar.bz2 prosody_auth-master.tar.xz prosody_auth-master.zip |
Diffstat (limited to 'mod_auth_custom')
-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 | ||