diff options
author | Richard Dale <richard.dale@codethink.co.uk> | 2015-03-21 05:14:02 +0000 |
---|---|---|
committer | Richard Dale <richard.dale@codethink.co.uk> | 2015-03-21 05:14:02 +0000 |
commit | 4a64e692075ce9c279a53e8d3809f8a41a28e797 (patch) | |
tree | f45752ab1ca20e9dd6f3512cc5f26af5a59ef305 | |
parent | 11613aea17644a02842e09ea28b1145b9f897d26 (diff) | |
download | linux-pam-4a64e692075ce9c279a53e8d3809f8a41a28e797.tar.gz |
Don't call innetgr() if not found in the config
-rw-r--r-- | modules/pam_group/pam_group.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/modules/pam_group/pam_group.c b/modules/pam_group/pam_group.c index be5f20f..15314d4 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] == '@') - good &= innetgr (&buffer[1], NULL, user, NULL); +#ifdef HAVE_INNETGR + good &= innetgr (&buffer[1], NULL, user, NULL); +#else + pam_syslog (pamh, LOG_ERR, "pam_access 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]); |