winbindd: winbindd_dc_info() -> bool_dispatch_table
authorVolker Lendecke <vl@samba.org>
Wed, 2 May 2018 16:27:23 +0000 (18:27 +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 714663b7c9f317de31b649b3a6f32fa5bcb625a4..1608a14974cab63f355d7df189564cfc6c7a100c 100644 (file)
@@ -535,7 +535,6 @@ static struct winbindd_dispatch_table {
        /* Miscellaneous */
 
        { WINBINDD_DOMAIN_INFO, winbindd_domain_info, "DOMAIN_INFO" },
        /* Miscellaneous */
 
        { WINBINDD_DOMAIN_INFO, winbindd_domain_info, "DOMAIN_INFO" },
-       { WINBINDD_DC_INFO, winbindd_dc_info, "DC_INFO" },
        { WINBINDD_PRIV_PIPE_DIR, winbindd_priv_pipe_dir,
          "WINBINDD_PRIV_PIPE_DIR" },
 
        { WINBINDD_PRIV_PIPE_DIR, winbindd_priv_pipe_dir,
          "WINBINDD_PRIV_PIPE_DIR" },
 
@@ -568,6 +567,9 @@ static struct winbindd_bool_dispatch_table {
        { WINBINDD_NETBIOS_NAME,
          winbindd_netbios_name,
          "NETBIOS_NAME" },
        { WINBINDD_NETBIOS_NAME,
          winbindd_netbios_name,
          "NETBIOS_NAME" },
+       { WINBINDD_DC_INFO,
+         winbindd_dc_info,
+         "DC_INFO" },
 };
 
 struct winbindd_async_dispatch_table {
 };
 
 struct winbindd_async_dispatch_table {
index db73784bff849ab81e7a9f792964bfdd1dd68137..e55fc4ef87442b2beda5957f0055404dc0f540d8 100644 (file)
@@ -452,7 +452,7 @@ static void domain_info_done(struct tevent_req *req)
        request_ok(state->cli);
 }
 
        request_ok(state->cli);
 }
 
-void winbindd_dc_info(struct winbindd_cli_state *cli)
+bool winbindd_dc_info(struct winbindd_cli_state *cli)
 {
        struct winbindd_domain *domain;
        char *dc_name, *dc_ip;
 {
        struct winbindd_domain *domain;
        char *dc_name, *dc_ip;
@@ -468,8 +468,7 @@ void winbindd_dc_info(struct winbindd_cli_state *cli)
                if (domain == NULL) {
                        DEBUG(10, ("Could not find domain %s\n",
                                   cli->request->domain_name));
                if (domain == NULL) {
                        DEBUG(10, ("Could not find domain %s\n",
                                   cli->request->domain_name));
-                       request_error(cli);
-                       return;
+                       return false;
                }
        } else {
                domain = find_our_domain();
                }
        } else {
                domain = find_our_domain();
@@ -479,8 +478,7 @@ void winbindd_dc_info(struct winbindd_cli_state *cli)
                    talloc_tos(), domain->name, &dc_name, &dc_ip)) {
                DEBUG(10, ("fetch_current_dc_from_gencache(%s) failed\n",
                           domain->name));
                    talloc_tos(), domain->name, &dc_name, &dc_ip)) {
                DEBUG(10, ("fetch_current_dc_from_gencache(%s) failed\n",
                           domain->name));
-               request_error(cli);
-               return;
+               return false;
        }
 
        cli->response->data.num_entries = 1;
        }
 
        cli->response->data.num_entries = 1;
@@ -491,15 +489,14 @@ void winbindd_dc_info(struct winbindd_cli_state *cli)
        TALLOC_FREE(dc_ip);
 
        if (cli->response->extra_data.data == NULL) {
        TALLOC_FREE(dc_ip);
 
        if (cli->response->extra_data.data == NULL) {
-               request_error(cli);
-               return;
+               return false;
        }
 
        /* must add one to length to copy the 0 for string termination */
        cli->response->length +=
                strlen((char *)cli->response->extra_data.data) + 1;
 
        }
 
        /* must add one to length to copy the 0 for string termination */
        cli->response->length +=
                strlen((char *)cli->response->extra_data.data) + 1;
 
-       request_ok(cli);
+       return true;
 }
 
 bool winbindd_ping(struct winbindd_cli_state *state)
 }
 
 bool winbindd_ping(struct winbindd_cli_state *state)
index e6ffee1bacb6d357b0d4a304e2ace7c0a235a30a..ea8225256bc39d68202eabaeebe4522db99e94f5 100644 (file)
@@ -386,7 +386,7 @@ enum winbindd_result winbindd_dual_list_trusted_domains(struct winbindd_domain *
                                                        struct winbindd_cli_state *state);
 void winbindd_show_sequence(struct winbindd_cli_state *state);
 void winbindd_domain_info(struct winbindd_cli_state *state);
                                                        struct winbindd_cli_state *state);
 void winbindd_show_sequence(struct winbindd_cli_state *state);
 void winbindd_domain_info(struct winbindd_cli_state *state);
-void winbindd_dc_info(struct winbindd_cli_state *state);
+bool winbindd_dc_info(struct winbindd_cli_state *state);
 bool winbindd_ping(struct winbindd_cli_state *state);
 bool winbindd_info(struct winbindd_cli_state *state);
 bool winbindd_interface_version(struct winbindd_cli_state *state);
 bool winbindd_ping(struct winbindd_cli_state *state);
 bool winbindd_info(struct winbindd_cli_state *state);
 bool winbindd_interface_version(struct winbindd_cli_state *state);