summaryrefslogtreecommitdiffstats
path: root/source/lib/util_getent.c
diff options
context:
space:
mode:
authorAndrew Tridgell <tridge@samba.org>2002-07-15 10:35:28 +0000
committerAndrew Tridgell <tridge@samba.org>2002-07-15 10:35:28 +0000
commit03ac082dcb375b6f3ca3d810a6a6367542bc23ce (patch)
treef13f085fad5de50ebe4b066eb7e2629d55032a2d /source/lib/util_getent.c
parentb8d39651fb90ef170055735412417239a63afc5d (diff)
downloadsamba-03ac082dcb375b6f3ca3d810a6a6367542bc23ce.tar.gz
samba-03ac082dcb375b6f3ca3d810a6a6367542bc23ce.tar.xz
samba-03ac082dcb375b6f3ca3d810a6a6367542bc23ce.zip
updated the 3.0 branch from the head branch - ready for alpha18
Diffstat (limited to 'source/lib/util_getent.c')
-rw-r--r--source/lib/util_getent.c30
1 files changed, 17 insertions, 13 deletions
diff --git a/source/lib/util_getent.c b/source/lib/util_getent.c
index 02e4b932ded..2e76121aae1 100644
--- a/source/lib/util_getent.c
+++ b/source/lib/util_getent.c
@@ -277,20 +277,24 @@ struct sys_userlist *get_users_in_group(const char *gname)
DOM_SID sid;
enum SID_NAME_USE name_type;
- (void) split_domain_and_name(gname, domain, groupname);
-
- /*
- * If we're doing this via winbindd, don't do the
- * entire group list enumeration as we know this is
- * pointless (and slow).
- */
-
- if (winbind_lookup_name(domain, groupname, &sid, &name_type) && name_type == SID_NAME_DOM_GRP) {
- if ((gptr = (struct group *)getgrnam(gname)) == NULL)
- return NULL;
- return add_members_to_userlist(list_head, gptr);
+ /* No point using winbind if we can't split it in the
+ first place */
+ if (split_domain_and_name(gname, domain, groupname)) {
+
+ /*
+ * If we're doing this via winbindd, don't do the
+ * entire group list enumeration as we know this is
+ * pointless (and slow).
+ */
+
+ if (winbind_lookup_name(domain, groupname, &sid, &name_type)
+ && name_type == SID_NAME_DOM_GRP) {
+ if ((gptr = (struct group *)getgrnam(gname)) == NULL)
+ return NULL;
+ return add_members_to_userlist(list_head, gptr);
+ }
}
-
+
setgrent();
while((gptr = getgrent()) != NULL) {
if (strequal(gname, gptr->gr_name)) {