From 629e73eeedb2aea2bda016bbc5559a66e3a86b59 Mon Sep 17 00:00:00 2001 From: Stefan Metzmacher Date: Mon, 19 Apr 2010 16:08:41 +0200 Subject: s4:winbind: fill response.data.num_entries for WINBINDD_LIST_GROUPS metze --- source4/winbind/wb_cmd_list_groups.c | 6 +++++- source4/winbind/wb_samba3_cmd.c | 4 +++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/source4/winbind/wb_cmd_list_groups.c b/source4/winbind/wb_cmd_list_groups.c index afb96b46fa..746ce8fc88 100644 --- a/source4/winbind/wb_cmd_list_groups.c +++ b/source4/winbind/wb_cmd_list_groups.c @@ -32,6 +32,7 @@ struct cmd_list_groups_state { char *domain_name; uint32_t resume_index; char *result; + uint32_t num_groups; }; static void cmd_list_groups_recv_domain(struct composite_context *ctx); @@ -55,6 +56,7 @@ struct composite_context *wb_cmd_list_groups_send(TALLOC_CTX *mem_ctx, result->private_data = state; state->service = service; state->resume_index = 0; + state->num_groups = 0; state->result = talloc_strdup(state, ""); if (composite_nomem(state->result, state->ctx)) return result; @@ -144,6 +146,7 @@ static void cmd_list_groups_recv_group_list(struct composite_context *ctx) state->result = talloc_asprintf_append_buffer(state->result, "%s,", group_list->out.groups[i].groupname); + state->num_groups++; } /* If the status is OK, we're finished, there's no more groups. @@ -176,7 +179,7 @@ static void cmd_list_groups_recv_group_list(struct composite_context *ctx) NTSTATUS wb_cmd_list_groups_recv(struct composite_context *ctx, TALLOC_CTX *mem_ctx, uint32_t *extra_data_len, - char **extra_data) + char **extra_data, uint32_t *num_groups) { NTSTATUS status = composite_wait(ctx); @@ -188,6 +191,7 @@ NTSTATUS wb_cmd_list_groups_recv(struct composite_context *ctx, *extra_data_len = strlen(state->result); *extra_data = talloc_steal(mem_ctx, state->result); + *num_groups = state->num_groups; } talloc_free(ctx); diff --git a/source4/winbind/wb_samba3_cmd.c b/source4/winbind/wb_samba3_cmd.c index 76f8207058..86ed827e6c 100644 --- a/source4/winbind/wb_samba3_cmd.c +++ b/source4/winbind/wb_samba3_cmd.c @@ -897,18 +897,20 @@ static void list_groups_recv(struct composite_context *ctx) struct wbsrv_samba3_call); uint32_t extra_data_len; char *extra_data; + uint32_t num_groups; NTSTATUS status; DEBUG(5, ("list_groups_recv called\n")); status = wb_cmd_list_groups_recv(ctx, s3call, &extra_data_len, - &extra_data); + &extra_data, &num_groups); if (NT_STATUS_IS_OK(status)) { s3call->response.extra_data.data = extra_data; s3call->response.length += extra_data_len; if (extra_data) { s3call->response.length += 1; + s3call->response.data.num_entries = num_groups; } } -- cgit