From 5c6c8e1fe93f340005110a7833946191659d88ab Mon Sep 17 00:00:00 2001 From: "Gerald (Jerry) Carter" Date: Wed, 10 Oct 2007 15:34:30 -0500 Subject: [GLUE] Rsync SAMBA_3_2_0 SVN r25598 in order to create the v3-2-test branch. --- source/winbindd/winbindd_dual.c | 40 +++++++++++++++++++++++++++++++--------- 1 file changed, 31 insertions(+), 9 deletions(-) (limited to 'source/winbindd/winbindd_dual.c') diff --git a/source/winbindd/winbindd_dual.c b/source/winbindd/winbindd_dual.c index 7e53fbbbeeb..d9a42c31dc1 100644 --- a/source/winbindd/winbindd_dual.c +++ b/source/winbindd/winbindd_dual.c @@ -408,14 +408,23 @@ void sendto_domain(struct winbindd_cli_state *state, recvfrom_child, state); } -const struct winbindd_child_dispatch_table domain_dispatch_table[] = { +struct winbindd_child_dispatch_table { + enum winbindd_cmd cmd; + enum winbindd_result (*fn)(struct winbindd_domain *domain, + struct winbindd_cli_state *state); + const char *winbindd_cmd_name; +}; + +static struct winbindd_child_dispatch_table child_dispatch_table[] = { + { WINBINDD_LOOKUPSID, winbindd_dual_lookupsid, "LOOKUPSID" }, { WINBINDD_LOOKUPNAME, winbindd_dual_lookupname, "LOOKUPNAME" }, { WINBINDD_LOOKUPRIDS, winbindd_dual_lookuprids, "LOOKUPRIDS" }, { WINBINDD_LIST_TRUSTDOM, winbindd_dual_list_trusted_domains, "LIST_TRUSTDOM" }, { WINBINDD_INIT_CONNECTION, winbindd_dual_init_connection, "INIT_CONNECTION" }, { WINBINDD_GETDCNAME, winbindd_dual_getdcname, "GETDCNAME" }, + { WINBINDD_DSGETDCNAME, winbindd_dual_dsgetdcname, "DSGETDCNAME" }, { WINBINDD_SHOW_SEQUENCE, winbindd_dual_show_sequence, "SHOW_SEQUENCE" }, { WINBINDD_PAM_AUTH, winbindd_dual_pam_auth, "PAM_AUTH" }, { WINBINDD_PAM_AUTH_CRAP, winbindd_dual_pam_auth_crap, "AUTH_CRAP" }, @@ -423,7 +432,23 @@ const struct winbindd_child_dispatch_table domain_dispatch_table[] = { { WINBINDD_PAM_CHNG_PSWD_AUTH_CRAP,winbindd_dual_pam_chng_pswd_auth_crap,"CHNG_PSWD_AUTH_CRAP" }, { WINBINDD_PAM_CHAUTHTOK, winbindd_dual_pam_chauthtok, "PAM_CHAUTHTOK" }, { WINBINDD_CHECK_MACHACC, winbindd_dual_check_machine_acct, "CHECK_MACHACC" }, + { WINBINDD_DUAL_SID2UID, winbindd_dual_sid2uid, "DUAL_SID2UID" }, + { WINBINDD_DUAL_SID2GID, winbindd_dual_sid2gid, "DUAL_SID2GID" }, +#if 0 /* DISABLED until we fix the interface in Samba 3.0.26 --jerry */ + { WINBINDD_DUAL_SIDS2XIDS, winbindd_dual_sids2xids, "DUAL_SIDS2XIDS" }, +#endif /* end DISABLED */ + { WINBINDD_DUAL_UID2SID, winbindd_dual_uid2sid, "DUAL_UID2SID" }, + { WINBINDD_DUAL_GID2SID, winbindd_dual_gid2sid, "DUAL_GID2SID" }, + { WINBINDD_DUAL_UID2NAME, winbindd_dual_uid2name, "DUAL_UID2NAME" }, + { WINBINDD_DUAL_NAME2UID, winbindd_dual_name2uid, "DUAL_NAME2UID" }, + { WINBINDD_DUAL_GID2NAME, winbindd_dual_gid2name, "DUAL_GID2NAME" }, + { WINBINDD_DUAL_NAME2GID, winbindd_dual_name2gid, "DUAL_NAME2GID" }, + { WINBINDD_DUAL_SET_MAPPING, winbindd_dual_set_mapping, "DUAL_SET_MAPPING" }, + { WINBINDD_DUAL_SET_HWM, winbindd_dual_set_hwm, "DUAL_SET_HWMS" }, + { WINBINDD_DUAL_DUMP_MAPS, winbindd_dual_dump_maps, "DUAL_DUMP_MAPS" }, { WINBINDD_DUAL_USERINFO, winbindd_dual_userinfo, "DUAL_USERINFO" }, + { WINBINDD_ALLOCATE_UID, winbindd_dual_allocate_uid, "ALLOCATE_UID" }, + { WINBINDD_ALLOCATE_GID, winbindd_dual_allocate_gid, "ALLOCATE_GID" }, { WINBINDD_GETUSERDOMGROUPS, winbindd_dual_getuserdomgroups, "GETUSERDOMGROUPS" }, { WINBINDD_DUAL_GETSIDALIASES, winbindd_dual_getsidaliases, "GETSIDALIASES" }, { WINBINDD_CCACHE_NTLMAUTH, winbindd_dual_ccache_ntlm_auth, "CCACHE_NTLM_AUTH" }, @@ -432,11 +457,10 @@ const struct winbindd_child_dispatch_table domain_dispatch_table[] = { { WINBINDD_NUM_CMDS, NULL, "NONE" } }; -static void child_process_request(struct winbindd_child *child, +static void child_process_request(struct winbindd_domain *domain, struct winbindd_cli_state *state) { - struct winbindd_domain *domain = child->domain; - const struct winbindd_child_dispatch_table *table = child->table; + struct winbindd_child_dispatch_table *table; /* Free response data - we may be interrupted and receive another command before being able to send this data off. */ @@ -449,7 +473,7 @@ static void child_process_request(struct winbindd_child *child, /* Process command */ - for (; table->fn; table++) { + for (table = child_dispatch_table; table->fn; table++) { if (state->request.cmd == table->cmd) { DEBUG(10,("process_request: request fn %s\n", table->winbindd_cmd_name )); @@ -459,7 +483,7 @@ static void child_process_request(struct winbindd_child *child, } if (!table->fn) { - DEBUG(1 ,("child_process_request: unknown request fn number %d\n", + DEBUG(10,("process_request: unknown request fn number %d\n", (int)state->request.cmd )); state->response.result = WINBINDD_ERROR; } @@ -467,7 +491,6 @@ static void child_process_request(struct winbindd_child *child, void setup_domain_child(struct winbindd_domain *domain, struct winbindd_child *child, - const struct winbindd_child_dispatch_table *table, const char *explicit_logfile) { if (explicit_logfile != NULL) { @@ -482,7 +505,6 @@ void setup_domain_child(struct winbindd_domain *domain, } child->domain = domain; - child->table = table; } struct winbindd_child *children = NULL; @@ -1084,7 +1106,7 @@ static BOOL fork_domain_child(struct winbindd_child *child) ZERO_STRUCT(state.response); state.request.null_term = '\0'; - child_process_request(child, &state); + child_process_request(child->domain, &state); SAFE_FREE(state.request.extra_data.data); -- cgit