From 835d64947996b7cc96fe187f9b3103db36dddf77 Mon Sep 17 00:00:00 2001 From: Thorsten Kukuk Date: Mon, 4 Apr 2016 11:39:45 +0200 Subject: innetgr may not be there so make sure that when innetgr is not present then we inform about it and not use it. [ticket#46] * modules/pam_group/pam_group.c: ditto * modules/pam_succeed_if/pam_succeed_if.c: ditto * modules/pam_time/pam_time.c: ditto Signed-off-by: Khem Raj Signed-off-by: Yousong Zhou --- modules/pam_group/pam_group.c | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'modules/pam_group') diff --git a/modules/pam_group/pam_group.c b/modules/pam_group/pam_group.c index da8237f1..263b3d51 100644 --- a/modules/pam_group/pam_group.c +++ b/modules/pam_group/pam_group.c @@ -656,7 +656,11 @@ static int check_account(pam_handle_t *pamh, const char *service, } /* If buffer starts with @, we are using netgroups */ if (buffer[0] == '@') +#ifdef HAVE_INNETGR good &= innetgr (&buffer[1], NULL, user, NULL); +#else + pam_syslog (pamh, LOG_ERR, "pam_group does not have netgroup support"); +#endif /* otherwise, if the buffer starts with %, it's a UNIX group */ else if (buffer[0] == '%') good &= pam_modutil_user_in_group_nam_nam(pamh, user, &buffer[1]); -- cgit v1.2.3