winbindd: winbindd_list_trusted_domains() -> bool_dispatch_table
authorVolker Lendecke <vl@samba.org>
Fri, 4 May 2018 19:19:06 +0000 (21:19 +0200)
committerVolker Lendecke <vl@samba.org>
Thu, 17 May 2018 06:44:19 +0000 (08:44 +0200)
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
source3/winbindd/winbindd.c
source3/winbindd/winbindd_misc.c
source3/winbindd/winbindd_proto.h

index 8e4071ac3f975949f1c9099e65a14b72a6e571da..28f048c2f265a1895a163778a1c68e192e6d7be5 100644 (file)
@@ -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 {
index f919f1c9324d4e8f7b1d8373a78cb241b1fcfcfd..c8b778db72728dcc9e3f1e3d144291ba4333f9fc 100644 (file)
@@ -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,
index 6231997ae3284a82911df20743414f6eb98ef88b..7eb92fb6c9cc606398382f3ebc7c47c2ea662032 100644 (file)
@@ -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);