diff options
author | Volker Lendecke <vlendec@samba.org> | 2005-06-24 14:25:18 +0000 |
---|---|---|
committer | Gerald (Jerry) Carter <jerry@samba.org> | 2007-10-10 10:58:00 -0500 |
commit | 702dd3da6297967ce140771110f85d61e0dff1e5 (patch) | |
tree | e06a266b02168ac5f0eebcc7d7ed9f5f946eb95b /source3/nsswitch/winbindd_group.c | |
parent | 57fa9dbfe7c69b0370e6f3ae8a82d9b6d391ef6b (diff) | |
download | samba-702dd3da6297967ce140771110f85d61e0dff1e5.tar.gz samba-702dd3da6297967ce140771110f85d61e0dff1e5.tar.bz2 samba-702dd3da6297967ce140771110f85d61e0dff1e5.zip |
r7877: Attempt to fix a smb_panic reported by Pavel Rochnyack.
Volker
(This used to be commit 7d1b890fead61551465e2a972e4097d9c1a4d6fd)
Diffstat (limited to 'source3/nsswitch/winbindd_group.c')
-rw-r--r-- | source3/nsswitch/winbindd_group.c | 21 |
1 files changed, 14 insertions, 7 deletions
diff --git a/source3/nsswitch/winbindd_group.c b/source3/nsswitch/winbindd_group.c index 2751f06815..65ae0bbf25 100644 --- a/source3/nsswitch/winbindd_group.c +++ b/source3/nsswitch/winbindd_group.c @@ -375,7 +375,7 @@ void winbindd_getgrgid(struct winbindd_cli_state *state) /* "Rewind" file pointer for group database enumeration */ -void winbindd_setgrent(struct winbindd_cli_state *state) +static BOOL winbindd_setgrent_internal(struct winbindd_cli_state *state) { struct winbindd_domain *domain; @@ -384,8 +384,7 @@ void winbindd_setgrent(struct winbindd_cli_state *state) /* Check user has enabled this */ if (!lp_winbind_enum_groups()) { - request_error(state); - return; + return False; } /* Free old static data if it exists */ @@ -413,8 +412,7 @@ void winbindd_setgrent(struct winbindd_cli_state *state) if ((domain_state = SMB_MALLOC_P(struct getent_state)) == NULL) { DEBUG(1, ("winbindd_setgrent: malloc failed for domain_state!\n")); - request_error(state); - return; + return False; } ZERO_STRUCTP(domain_state); @@ -427,7 +425,16 @@ void winbindd_setgrent(struct winbindd_cli_state *state) } state->getgrent_initialized = True; - request_ok(state); + return True; +} + +void winbindd_setgrent(struct winbindd_cli_state *state) +{ + if (winbindd_setgrent_internal(state)) { + request_ok(state); + } else { + request_error(state); + } } /* Close file pointer to ntdom group database */ @@ -592,7 +599,7 @@ void winbindd_getgrent(struct winbindd_cli_state *state) group_list = (struct winbindd_gr *)state->response.extra_data; if (!state->getgrent_initialized) - winbindd_setgrent(state); + winbindd_setgrent_internal(state); if (!(ent = state->getgrent_state)) { request_error(state); |