From 9148979197b76102b753635ecad615f25cb61cb1 Mon Sep 17 00:00:00 2001 From: Gregor Kleen Date: Wed, 30 Sep 2015 16:52:38 +0200 Subject: switch to newer posix semantic --- mod_auth_custom/mod_auth_custom.lua | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) (limited to 'mod_auth_custom/mod_auth_custom.lua') 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 @@ local posix = require "posix.grp"; local pam = require "pam"; -local new_sasl = require "util.sasl".new; - -function user_exists(username) - for i,v in ipairs(posix.getgroup("xmpp")) do +local new_sasl = require "util.sasl".new; + +function is_real_user(username) + for i,v in ipairs(posix.getgrnam("xmpp").gr_mem) do if username == v then return true; end end return false; +end + +function user_exists(username) + return is_real_user(username); end function test_password(username, password) -- cgit v1.2.3