From 737f82e3b3150c0d1f981d6d949978ea33af119c Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Tue, 18 Feb 2003 04:48:32 +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 a21154961135def29d7ede302ed09ce52fc22fc1) --- source3/lib/util_getent.c | 7 +++++++ 1 file changed, 7 insertions(+) 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