From 7b11e917590ff581143ed8d5e01905aa3fb979bd Mon Sep 17 00:00:00 2001 From: Volker Lendecke Date: Fri, 4 May 2018 21:19:06 +0200 Subject: [PATCH] winbindd: winbindd_list_trusted_domains() -> bool_dispatch_table Signed-off-by: Volker Lendecke Reviewed-by: Stefan Metzmacher --- source3/winbindd/winbindd.c | 5 +++-- source3/winbindd/winbindd_misc.c | 8 ++++---- source3/winbindd/winbindd_proto.h | 2 +- 3 files changed, 8 insertions(+), 7 deletions(-) diff --git a/source3/winbindd/winbindd.c b/source3/winbindd/winbindd.c index 8e4071ac3f9..28f048c2f26 100644 --- a/source3/winbindd/winbindd.c +++ b/source3/winbindd/winbindd.c @@ -529,8 +529,6 @@ static struct winbindd_dispatch_table { /* Enumeration functions */ - { WINBINDD_LIST_TRUSTDOM, winbindd_list_trusted_domains, - "LIST_TRUSTDOM" }, /* Miscellaneous */ @@ -574,6 +572,9 @@ static struct winbindd_bool_dispatch_table { { WINBINDD_PRIV_PIPE_DIR, winbindd_priv_pipe_dir, "WINBINDD_PRIV_PIPE_DIR" }, + { WINBINDD_LIST_TRUSTDOM, + winbindd_list_trusted_domains, + "LIST_TRUSTDOM" }, }; struct winbindd_async_dispatch_table { diff --git a/source3/winbindd/winbindd_misc.c b/source3/winbindd/winbindd_misc.c index f919f1c9324..c8b778db727 100644 --- a/source3/winbindd/winbindd_misc.c +++ b/source3/winbindd/winbindd_misc.c @@ -203,25 +203,24 @@ static bool trust_is_transitive(struct winbindd_tdc_domain *domain) return transitive; } -void winbindd_list_trusted_domains(struct winbindd_cli_state *state) +bool winbindd_list_trusted_domains(struct winbindd_cli_state *state) { struct winbindd_tdc_domain *dom_list = NULL; size_t num_domains = 0; int extra_data_len = 0; char *extra_data = NULL; int i = 0; + bool ret = false; DEBUG(3, ("[%5lu]: list trusted domains\n", (unsigned long)state->pid)); if( !wcache_tdc_fetch_list( &dom_list, &num_domains )) { - request_error(state); goto done; } extra_data = talloc_strdup(state->mem_ctx, ""); if (extra_data == NULL) { - request_error(state); goto done; } @@ -269,9 +268,10 @@ void winbindd_list_trusted_domains(struct winbindd_cli_state *state) state->response->length += extra_data_len; } - request_ok(state); + ret = true; done: TALLOC_FREE( dom_list ); + return ret; } enum winbindd_result winbindd_dual_list_trusted_domains(struct winbindd_domain *domain, diff --git a/source3/winbindd/winbindd_proto.h b/source3/winbindd/winbindd_proto.h index 6231997ae32..7eb92fb6c9c 100644 --- a/source3/winbindd/winbindd_proto.h +++ b/source3/winbindd/winbindd_proto.h @@ -381,7 +381,7 @@ struct dcerpc_binding_handle *locator_child_handle(void); /* The following definitions come from winbindd/winbindd_misc.c */ -void winbindd_list_trusted_domains(struct winbindd_cli_state *state); +bool winbindd_list_trusted_domains(struct winbindd_cli_state *state); enum winbindd_result winbindd_dual_list_trusted_domains(struct winbindd_domain *domain, struct winbindd_cli_state *state); void winbindd_show_sequence(struct winbindd_cli_state *state);