mirror of
https://github.com/samba-team/samba.git
synced 2024-12-24 21:34:56 +03:00
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 <scabrero@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org> Autobuild-User(master): Jeremy Allison <jra@samba.org> Autobuild-Date(master): Thu May 19 18:50:24 UTC 2022 on sn-devel-184
This commit is contained in:
parent
95698da905
commit
9bacf7529d
@ -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 */
|
||||
|
@ -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; i<lp_winbind_max_domain_connections(); i++) {
|
||||
setup_child(domain, &domain->children[i],
|
||||
domain_dispatch_table,
|
||||
"log.wb", domain->name);
|
||||
domain->children[i].domain = domain;
|
||||
}
|
||||
|
@ -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);
|
||||
|
||||
|
@ -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;
|
||||
}
|
||||
|
@ -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");
|
||||
}
|
||||
|
@ -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--;
|
||||
}
|
||||
|
||||
|
@ -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);
|
||||
|
Loading…
Reference in New Issue
Block a user