--- samba-2.2.5-orig/source/lib/util_getent.c Tue Jun 18 13:46:06 2002 +++ samba-2.2.5/source/lib/util_getent.c Thu Sep 12 15:24:11 2002 @@ -286,6 +286,10 @@ return add_members_to_userlist(list_head, gptr); } + /* This code is too slow when using an LDAP server since we + end up listing all the groups over and over again. See below + for the fix. + setgrent(); while((gptr = getgrent()) != NULL) { if (strequal(gname, gptr->gr_name)) { @@ -295,6 +299,15 @@ } } endgrent(); + */ + + /* Fixed code */ + + gptr = getgrnam(gname); + if (gptr != NULL) { + list_head = add_members_to_userlist(list_head, gptr); + } + return list_head; }