From: Samuel Cabrero Date: Tue, 22 Jun 2021 08:44:53 +0000 (+0200) Subject: s3:winbind: Remove struct winbindd_child_dispatch_table X-Git-Tag: talloc-2.3.4~96 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=9bacf7529dd74b0307215b3ff00d8de20bf77a57;p=thirdparty%2Fsamba.git s3:winbind: Remove struct winbindd_child_dispatch_table All parent-child communication is based in NDR and dispatched as a local RPC call. Signed-off-by: Samuel Cabrero Reviewed-by: Jeremy Allison Autobuild-User(master): Jeremy Allison Autobuild-Date(master): Thu May 19 18:50:24 UTC 2022 on sn-devel-184 --- diff --git a/source3/winbindd/winbindd.h b/source3/winbindd/winbindd.h index fe286a9a686..ea5c1c0d834 100644 --- a/source3/winbindd/winbindd.h +++ b/source3/winbindd/winbindd.h @@ -103,13 +103,6 @@ struct winbindd_cm_conn { struct winbindd_domain; -struct winbindd_child_dispatch_table { - const char *name; - enum winbindd_cmd struct_cmd; - enum winbindd_result (*struct_fn)(struct winbindd_domain *domain, - struct winbindd_cli_state *state); -}; - struct winbindd_child { pid_t pid; struct winbindd_domain *domain; @@ -122,8 +115,6 @@ struct winbindd_child { struct tevent_timer *lockout_policy_event; struct tevent_timer *machine_password_change_event; - - const struct winbindd_child_dispatch_table *table; }; /* Structures to hold per domain information */ diff --git a/source3/winbindd/winbindd_domain.c b/source3/winbindd/winbindd_domain.c index e5d461261b0..b1027735c8a 100644 --- a/source3/winbindd/winbindd_domain.c +++ b/source3/winbindd/winbindd_domain.c @@ -25,23 +25,12 @@ #undef DBGC_CLASS #define DBGC_CLASS DBGC_WINBIND -static const struct winbindd_child_dispatch_table domain_dispatch_table[] = { - { - .name = "NDRCMD", - .struct_cmd = WINBINDD_DUAL_NDRCMD, - .struct_fn = winbindd_dual_ndrcmd, - },{ - .name = NULL, - } -}; - void setup_domain_child(struct winbindd_domain *domain) { int i; for (i=0; ichildren[i], - domain_dispatch_table, "log.wb", domain->name); domain->children[i].domain = domain; } diff --git a/source3/winbindd/winbindd_dual.c b/source3/winbindd/winbindd_dual.c index bf90515509b..75ecdf53968 100644 --- a/source3/winbindd/winbindd_dual.c +++ b/source3/winbindd/winbindd_dual.c @@ -761,7 +761,6 @@ static void child_process_request(struct winbindd_child *child, struct winbindd_cli_state *state) { struct winbindd_domain *domain = child->domain; - const struct winbindd_child_dispatch_table *table = child->table; /* Free response data - we may be interrupted and receive another command before being able to send this data off. */ @@ -773,15 +772,7 @@ static void child_process_request(struct winbindd_child *child, state->mem_ctx = talloc_tos(); /* Process command */ - - for (; table->name; table++) { - if (state->request->cmd == table->struct_cmd) { - DEBUG(10,("child_process_request: request fn %s\n", - table->name)); - state->response->result = table->struct_fn(domain, state); - return; - } - } + state->response->result = winbindd_dual_ndrcmd(domain, state); DEBUG(1, ("child_process_request: unknown request fn number %d\n", (int)state->request->cmd)); @@ -789,7 +780,6 @@ static void child_process_request(struct winbindd_child *child, } void setup_child(struct winbindd_domain *domain, struct winbindd_child *child, - const struct winbindd_child_dispatch_table *table, const char *logprefix, const char *logname) { @@ -830,7 +820,6 @@ void setup_child(struct winbindd_domain *domain, struct winbindd_child *child, child->pid = 0; child->sock = -1; child->domain = domain; - child->table = table; child->queue = tevent_queue_create(NULL, "winbind_child"); SMB_ASSERT(child->queue != NULL); diff --git a/source3/winbindd/winbindd_idmap.c b/source3/winbindd/winbindd_idmap.c index 79775a03c8b..e6d2c284cf2 100644 --- a/source3/winbindd/winbindd_idmap.c +++ b/source3/winbindd/winbindd_idmap.c @@ -68,16 +68,6 @@ struct dcerpc_binding_handle *idmap_child_handle(void) return static_idmap_child.binding_handle; } -static const struct winbindd_child_dispatch_table idmap_dispatch_table[] = { - { - .name = "NDRCMD", - .struct_cmd = WINBINDD_DUAL_NDRCMD, - .struct_fn = winbindd_dual_ndrcmd, - },{ - .name = NULL, - } -}; - static void init_idmap_child_done(struct tevent_req *subreq); void init_idmap_child(void) @@ -339,9 +329,7 @@ static void wb_parent_idmap_setup_lookupname_next(struct tevent_req *req) /* * We're done, so start the idmap child */ - setup_child(NULL, &static_idmap_child, - idmap_dispatch_table, - "log.winbindd", "idmap"); + setup_child(NULL, &static_idmap_child, "log.winbindd", "idmap"); tevent_req_done(req); return; } diff --git a/source3/winbindd/winbindd_locator.c b/source3/winbindd/winbindd_locator.c index e31d1031bb9..653ee93d122 100644 --- a/source3/winbindd/winbindd_locator.c +++ b/source3/winbindd/winbindd_locator.c @@ -39,19 +39,7 @@ struct dcerpc_binding_handle *locator_child_handle(void) return static_locator_child.binding_handle; } -static const struct winbindd_child_dispatch_table locator_dispatch_table[] = { - { - .name = "NDRCMD", - .struct_cmd = WINBINDD_DUAL_NDRCMD, - .struct_fn = winbindd_dual_ndrcmd, - },{ - .name = NULL, - } -}; - void init_locator_child(void) { - setup_child(NULL, &static_locator_child, - locator_dispatch_table, - "log.winbindd", "locator"); + setup_child(NULL, &static_locator_child, "log.winbindd", "locator"); } diff --git a/source3/winbindd/winbindd_ndr.c b/source3/winbindd/winbindd_ndr.c index b393586a692..7b48ddb2b90 100644 --- a/source3/winbindd/winbindd_ndr.c +++ b/source3/winbindd/winbindd_ndr.c @@ -45,7 +45,6 @@ void ndr_print_winbindd_child(struct ndr_print *ndr, ndr_print_string(ndr, "logfilename", r->logfilename); /* struct fd_event event; */ ndr_print_ptr(ndr, "lockout_policy_event", r->lockout_policy_event); - ndr_print_ptr(ndr, "table", r->table); ndr->depth--; } diff --git a/source3/winbindd/winbindd_proto.h b/source3/winbindd/winbindd_proto.h index 7774f2837aa..7c5f7ad91bb 100644 --- a/source3/winbindd/winbindd_proto.h +++ b/source3/winbindd/winbindd_proto.h @@ -292,7 +292,6 @@ int wb_domain_request_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx, struct winbindd_response **presponse, int *err); void setup_child(struct winbindd_domain *domain, struct winbindd_child *child, - const struct winbindd_child_dispatch_table *table, const char *logprefix, const char *logname); void winbind_child_died(pid_t pid);