From fb8d1412e1e109a1af8acc759c128df8c82bd47d Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Tue, 18 Feb 2003 04:49:31 +0000 Subject: Ensure we use getgrnam() unless BROKEN_GETGRNAM is defined. I now need to set this for Tru64. Jeremy. (This used to be commit e7c4616c45ea5ec7c04022d6cca49ac70adde121) --- source3/lib/util_getent.c | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'source3/lib/util_getent.c') diff --git a/source3/lib/util_getent.c b/source3/lib/util_getent.c index 6699ce3e92..7d45287bba 100644 --- a/source3/lib/util_getent.c +++ b/source3/lib/util_getent.c @@ -274,6 +274,12 @@ struct sys_userlist *get_users_in_group(const char *gname) } } +#if !defined(BROKEN_GETGRNAM) + if ((gptr = (struct group *)getgrnam(gname)) == NULL) + return NULL; + return add_members_to_userlist(list_head, gptr); +#else + /* BROKEN_GETGRNAM - True64 */ setgrent(); while((gptr = getgrent()) != NULL) { if (strequal(gname, gptr->gr_name)) { @@ -284,6 +290,7 @@ struct sys_userlist *get_users_in_group(const char *gname) } endgrent(); return list_head; +#endif } /**************************************************************** -- cgit