diff options
author | Gregor Kleen <gkleen@yggdrasil.li> | 2015-09-30 22:49:54 +0200 |
---|---|---|
committer | Gregor Kleen <gkleen@yggdrasil.li> | 2015-09-30 22:49:54 +0200 |
commit | 0d4b0b7b4d538a16e57f7106b6dc878788123333 (patch) | |
tree | aa021050d8ccc548f3421925cfdfc32f1748b9aa /mod_auth_custom | |
parent | 8d740aedb73a957d51ef7df8058fbb833ef8ee6b (diff) | |
download | prosody_auth-0d4b0b7b4d538a16e57f7106b6dc878788123333.tar prosody_auth-0d4b0b7b4d538a16e57f7106b6dc878788123333.tar.gz prosody_auth-0d4b0b7b4d538a16e57f7106b6dc878788123333.tar.bz2 prosody_auth-0d4b0b7b4d538a16e57f7106b6dc878788123333.tar.xz prosody_auth-0d4b0b7b4d538a16e57f7106b6dc878788123333.zip |
increased priority of aliases over real users
Diffstat (limited to 'mod_auth_custom')
-rw-r--r-- | mod_auth_custom/mod_auth_custom.lua | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/mod_auth_custom/mod_auth_custom.lua b/mod_auth_custom/mod_auth_custom.lua index cfded11..109f387 100644 --- a/mod_auth_custom/mod_auth_custom.lua +++ b/mod_auth_custom/mod_auth_custom.lua | |||
@@ -65,14 +65,14 @@ end | |||
65 | function get_sasl_handler() | 65 | function get_sasl_handler() |
66 | return new_sasl(module.host, { | 66 | return new_sasl(module.host, { |
67 | plain_test = function(sasl, username, password, ...) | 67 | plain_test = function(sasl, username, password, ...) |
68 | if is_real_user(username) then | 68 | if is_alias(username) then |
69 | return pam_auth(username, password); | ||
70 | elseif is_alias(username) then | ||
71 | if password == alias_pw(username) then | 69 | if password == alias_pw(username) then |
72 | return true, true; | 70 | return true, true; |
73 | else | 71 | else |
74 | return nil, true; | 72 | return nil, true; |
75 | end | 73 | end |
74 | elseif is_real_user(username) then | ||
75 | return pam_auth(username, password); | ||
76 | else | 76 | else |
77 | return nil, true; | 77 | return nil, true; |
78 | end | 78 | end |