summaryrefslogtreecommitdiff
path: root/source3/nsswitch/winbindd_group.c
diff options
context:
space:
mode:
authorGerald Carter <jerry@samba.org>2004-04-28 20:07:51 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 10:51:21 -0500
commitce55cf1b825ce1d76310aff6829eafc8defe53ad (patch)
tree643c77fc55fdb19c280230fdbd248e2190292e31 /source3/nsswitch/winbindd_group.c
parent37c838b3e2f8180fe46be256e373d1e2eaefb00d (diff)
downloadsamba-ce55cf1b825ce1d76310aff6829eafc8defe53ad.tar.gz
samba-ce55cf1b825ce1d76310aff6829eafc8defe53ad.tar.bz2
samba-ce55cf1b825ce1d76310aff6829eafc8defe53ad.zip
r395: BUG 1232: patch from landonf@opendarwin.org (Landon Fuller) to fix
user/group enumeration on systems whose libc does not call setgrent() before trying to enumerate users (i.e. FreeBSD 5.2) (This used to be commit 8106d8097258eae260ed834399881bf0be9b515b)
Diffstat (limited to 'source3/nsswitch/winbindd_group.c')
-rw-r--r--source3/nsswitch/winbindd_group.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/source3/nsswitch/winbindd_group.c b/source3/nsswitch/winbindd_group.c
index ec77d2db34..4800ab20cf 100644
--- a/source3/nsswitch/winbindd_group.c
+++ b/source3/nsswitch/winbindd_group.c
@@ -472,6 +472,8 @@ enum winbindd_result winbindd_setgrent(struct winbindd_cli_state *state)
DLIST_ADD(state->getgrent_state, domain_state);
}
+ state->getgrent_initialized = True;
+
return WINBINDD_OK;
}
@@ -482,6 +484,7 @@ enum winbindd_result winbindd_endgrent(struct winbindd_cli_state *state)
DEBUG(3, ("[%5lu]: endgrent\n", (unsigned long)state->pid));
free_getent_state(state->getgrent_state);
+ state->getgrent_initialized = False;
state->getgrent_state = NULL;
return WINBINDD_OK;
@@ -632,6 +635,9 @@ enum winbindd_result winbindd_getgrent(struct winbindd_cli_state *state)
group_list = (struct winbindd_gr *)state->response.extra_data;
+ if (!state->getgrent_initialized)
+ winbindd_setgrent(state);
+
if (!(ent = state->getgrent_state))
return WINBINDD_ERROR;