diff options
Diffstat (limited to 'source4/winbind')
-rw-r--r-- | source4/winbind/wb_cmd_list_users.c | 6 | ||||
-rw-r--r-- | source4/winbind/wb_samba3_cmd.c | 4 |
2 files changed, 8 insertions, 2 deletions
diff --git a/source4/winbind/wb_cmd_list_users.c b/source4/winbind/wb_cmd_list_users.c index ac44794acd..4728f3ad55 100644 --- a/source4/winbind/wb_cmd_list_users.c +++ b/source4/winbind/wb_cmd_list_users.c @@ -32,6 +32,7 @@ struct cmd_list_users_state { char *domain_name; uint32_t resume_index; char *result; + uint32_t num_users; }; static void cmd_list_users_recv_domain(struct composite_context *ctx); @@ -55,6 +56,7 @@ struct composite_context *wb_cmd_list_users_send(TALLOC_CTX *mem_ctx, result->private_data = state; state->service = service; state->resume_index = 0; + state->num_users = 0; state->result = talloc_strdup(state, ""); if (composite_nomem(state->result, state->ctx)) return result; @@ -142,6 +144,7 @@ static void cmd_list_users_recv_user_list(struct composite_context *ctx) DEBUG(5, ("Appending user '%s'\n", user_list->out.users[i].username)); state->result = talloc_asprintf_append_buffer(state->result, "%s,", user_list->out.users[i].username); + state->num_users++; } /* If the status is OK, we're finished, there's no more users. @@ -174,7 +177,7 @@ static void cmd_list_users_recv_user_list(struct composite_context *ctx) NTSTATUS wb_cmd_list_users_recv(struct composite_context *ctx, TALLOC_CTX *mem_ctx, uint32_t *extra_data_len, - char **extra_data) + char **extra_data, uint32_t *num_users) { NTSTATUS status = composite_wait(ctx); @@ -186,6 +189,7 @@ NTSTATUS wb_cmd_list_users_recv(struct composite_context *ctx, *extra_data_len = strlen(state->result); *extra_data = talloc_steal(mem_ctx, state->result); + *num_users = state->num_users; } talloc_free(ctx); diff --git a/source4/winbind/wb_samba3_cmd.c b/source4/winbind/wb_samba3_cmd.c index 86ed827e6c..c66d696cce 100644 --- a/source4/winbind/wb_samba3_cmd.c +++ b/source4/winbind/wb_samba3_cmd.c @@ -946,18 +946,20 @@ static void list_users_recv(struct composite_context *ctx) struct wbsrv_samba3_call); uint32_t extra_data_len; char *extra_data; + uint32_t num_users; NTSTATUS status; DEBUG(5, ("list_users_recv called\n")); status = wb_cmd_list_users_recv(ctx, s3call, &extra_data_len, - &extra_data); + &extra_data, &num_users); 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_users; } } |