diff options
author | Gregor Kleen <gkleen@yggdrasil.li> | 2015-09-30 16:52:38 +0200 |
---|---|---|
committer | Gregor Kleen <gkleen@yggdrasil.li> | 2015-09-30 16:52:38 +0200 |
commit | 9148979197b76102b753635ecad615f25cb61cb1 (patch) | |
tree | 7f78490b4ddc5698118674672e58a9f5acdfce7c /mod_auth_custom | |
parent | eb68d998a10b436194cc81f9a64620606b1bd216 (diff) | |
download | prosody_auth-9148979197b76102b753635ecad615f25cb61cb1.tar prosody_auth-9148979197b76102b753635ecad615f25cb61cb1.tar.gz prosody_auth-9148979197b76102b753635ecad615f25cb61cb1.tar.bz2 prosody_auth-9148979197b76102b753635ecad615f25cb61cb1.tar.xz prosody_auth-9148979197b76102b753635ecad615f25cb61cb1.zip |
switch to newer posix semantic
Diffstat (limited to 'mod_auth_custom')
-rw-r--r-- | mod_auth_custom/mod_auth_custom.lua | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/mod_auth_custom/mod_auth_custom.lua b/mod_auth_custom/mod_auth_custom.lua index e917b6a..9b4872e 100644 --- a/mod_auth_custom/mod_auth_custom.lua +++ b/mod_auth_custom/mod_auth_custom.lua | |||
@@ -1,14 +1,18 @@ | |||
1 | local posix = require "posix.grp"; | 1 | local posix = require "posix.grp"; |
2 | local pam = require "pam"; | 2 | local pam = require "pam"; |
3 | local new_sasl = require "util.sasl".new; | 3 | local new_sasl = require "util.sasl".new; |
4 | 4 | ||
5 | function user_exists(username) | 5 | function is_real_user(username) |
6 | for i,v in ipairs(posix.getgroup("xmpp")) do | 6 | for i,v in ipairs(posix.getgrnam("xmpp").gr_mem) do |
7 | if username == v then | 7 | if username == v then |
8 | return true; | 8 | return true; |
9 | end | 9 | end |
10 | end | 10 | end |
11 | return false; | 11 | return false; |
12 | end | ||
13 | |||
14 | function user_exists(username) | ||
15 | return is_real_user(username); | ||
12 | end | 16 | end |
13 | 17 | ||
14 | function test_password(username, password) | 18 | function test_password(username, password) |