diff options
author | Volker Lendecke <vl@samba.org> | 2009-11-08 09:53:08 +0100 |
---|---|---|
committer | Volker Lendecke <vl@samba.org> | 2009-11-08 13:12:13 +0100 |
commit | daa964013bc5d036f4da571ce22c0052ef40943a (patch) | |
tree | fa94d2690f3b5f334f823ec266bb6aa1023b324d /source3 | |
parent | 70c698fd547c4bc19cf77693608bbb34acac40b5 (diff) | |
download | samba-daa964013bc5d036f4da571ce22c0052ef40943a.tar.gz samba-daa964013bc5d036f4da571ce22c0052ef40943a.tar.bz2 samba-daa964013bc5d036f4da571ce22c0052ef40943a.zip |
s3: Do not reference ndr_table_<pipe> in the cli_ routines directly
Diffstat (limited to 'source3')
-rw-r--r-- | source3/include/client.h | 4 | ||||
-rw-r--r-- | source3/include/proto.h | 16 | ||||
-rw-r--r-- | source3/librpc/gen_ndr/cli_wbint.c | 92 | ||||
-rw-r--r-- | source3/librpc/gen_ndr/srv_wbint.c | 2 | ||||
-rw-r--r-- | source3/librpc/gen_ndr/srv_wbint.h | 2 | ||||
-rw-r--r-- | source3/rpc_client/ndr.c | 21 | ||||
-rw-r--r-- | source3/rpc_server/srv_pipe_hnd.c | 3 | ||||
-rw-r--r-- | source3/winbindd/winbindd_dual_ndr.c | 11 |
8 files changed, 88 insertions, 63 deletions
diff --git a/source3/include/client.h b/source3/include/client.h index 82d94b055f..3b3931bb6b 100644 --- a/source3/include/client.h +++ b/source3/include/client.h @@ -123,14 +123,14 @@ struct rpc_pipe_client { NTSTATUS (*dispatch) (struct rpc_pipe_client *cli, TALLOC_CTX *mem_ctx, - const struct ndr_interface_table *table, + const char *interface, uint32_t interface_version, uint32_t opnum, void *r); struct tevent_req *(*dispatch_send)( TALLOC_CTX *mem_ctx, struct tevent_context *ev, struct rpc_pipe_client *cli, - const struct ndr_interface_table *table, + const char *interface, uint32_t interface_version, uint32_t opnum, void *r); NTSTATUS (*dispatch_recv)(struct tevent_req *req, diff --git a/source3/include/proto.h b/source3/include/proto.h index 2364360d4f..a0355732e7 100644 --- a/source3/include/proto.h +++ b/source3/include/proto.h @@ -5310,8 +5310,13 @@ NTSTATUS rpc_pipe_open_tcp(TALLOC_CTX *mem_ctx, const char *host, NTSTATUS rpc_pipe_open_ncalrpc(TALLOC_CTX *mem_ctx, const char *socket_path, const struct ndr_syntax_id *abstract_syntax, struct rpc_pipe_client **presult); -NTSTATUS rpc_pipe_open_internal(TALLOC_CTX *mem_ctx, const struct ndr_syntax_id *abstract_syntax, - NTSTATUS (*dispatch) (struct rpc_pipe_client *cli, TALLOC_CTX *mem_ctx, const struct ndr_interface_table *table, uint32_t opnum, void *r), +NTSTATUS rpc_pipe_open_internal(TALLOC_CTX *mem_ctx, + const struct ndr_syntax_id *abstract_syntax, + NTSTATUS (*dispatch) (struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + const char *interface, + uint32_t interface_version, + uint32_t opnum, void *r), struct auth_serversupplied_info *serversupplied_info, struct rpc_pipe_client **presult); NTSTATUS cli_rpc_pipe_open_noauth(struct cli_state *cli, @@ -5634,14 +5639,15 @@ void init_samr_CryptPassword(const char *pwd, struct tevent_req *cli_do_rpc_ndr_send(TALLOC_CTX *mem_ctx, struct tevent_context *ev, struct rpc_pipe_client *cli, - const struct ndr_interface_table *table, + const char *interface, + uint32_t interface_version, uint32_t opnum, void *r); NTSTATUS cli_do_rpc_ndr_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx); NTSTATUS cli_do_rpc_ndr(struct rpc_pipe_client *cli, TALLOC_CTX *mem_ctx, - const struct ndr_interface_table *table, - uint32 opnum, void *r); + const char *interface, uint32_t interface_version, + uint32_t opnum, void *r); /* The following definitions come from rpc_parse/parse_misc.c */ diff --git a/source3/librpc/gen_ndr/cli_wbint.c b/source3/librpc/gen_ndr/cli_wbint.c index 3115a20d9d..9b64375b95 100644 --- a/source3/librpc/gen_ndr/cli_wbint.c +++ b/source3/librpc/gen_ndr/cli_wbint.c @@ -49,7 +49,7 @@ struct tevent_req *rpccli_wbint_Ping_send(TALLOC_CTX *mem_ctx, state->tmp = state->orig; subreq = cli->dispatch_send(state, ev, cli, - &ndr_table_wbint, + NDR_WBINT_UUID, NDR_WBINT_VERSION, NDR_WBINT_PING, &state->tmp); if (tevent_req_nomem(subreq, req)) { @@ -122,7 +122,7 @@ NTSTATUS rpccli_wbint_Ping(struct rpc_pipe_client *cli, status = cli->dispatch(cli, mem_ctx, - &ndr_table_wbint, + NDR_WBINT_UUID, NDR_WBINT_VERSION, NDR_WBINT_PING, &r); @@ -191,7 +191,7 @@ struct tevent_req *rpccli_wbint_LookupSid_send(TALLOC_CTX *mem_ctx, state->tmp = state->orig; subreq = cli->dispatch_send(state, ev, cli, - &ndr_table_wbint, + NDR_WBINT_UUID, NDR_WBINT_VERSION, NDR_WBINT_LOOKUPSID, &state->tmp); if (tevent_req_nomem(subreq, req)) { @@ -275,7 +275,7 @@ NTSTATUS rpccli_wbint_LookupSid(struct rpc_pipe_client *cli, status = cli->dispatch(cli, mem_ctx, - &ndr_table_wbint, + NDR_WBINT_UUID, NDR_WBINT_VERSION, NDR_WBINT_LOOKUPSID, &r); @@ -348,7 +348,7 @@ struct tevent_req *rpccli_wbint_LookupName_send(TALLOC_CTX *mem_ctx, state->tmp = state->orig; subreq = cli->dispatch_send(state, ev, cli, - &ndr_table_wbint, + NDR_WBINT_UUID, NDR_WBINT_VERSION, NDR_WBINT_LOOKUPNAME, &state->tmp); if (tevent_req_nomem(subreq, req)) { @@ -434,7 +434,7 @@ NTSTATUS rpccli_wbint_LookupName(struct rpc_pipe_client *cli, status = cli->dispatch(cli, mem_ctx, - &ndr_table_wbint, + NDR_WBINT_UUID, NDR_WBINT_VERSION, NDR_WBINT_LOOKUPNAME, &r); @@ -502,7 +502,7 @@ struct tevent_req *rpccli_wbint_Sid2Uid_send(TALLOC_CTX *mem_ctx, state->tmp = state->orig; subreq = cli->dispatch_send(state, ev, cli, - &ndr_table_wbint, + NDR_WBINT_UUID, NDR_WBINT_VERSION, NDR_WBINT_SID2UID, &state->tmp); if (tevent_req_nomem(subreq, req)) { @@ -584,7 +584,7 @@ NTSTATUS rpccli_wbint_Sid2Uid(struct rpc_pipe_client *cli, status = cli->dispatch(cli, mem_ctx, - &ndr_table_wbint, + NDR_WBINT_UUID, NDR_WBINT_VERSION, NDR_WBINT_SID2UID, &r); @@ -651,7 +651,7 @@ struct tevent_req *rpccli_wbint_Sid2Gid_send(TALLOC_CTX *mem_ctx, state->tmp = state->orig; subreq = cli->dispatch_send(state, ev, cli, - &ndr_table_wbint, + NDR_WBINT_UUID, NDR_WBINT_VERSION, NDR_WBINT_SID2GID, &state->tmp); if (tevent_req_nomem(subreq, req)) { @@ -733,7 +733,7 @@ NTSTATUS rpccli_wbint_Sid2Gid(struct rpc_pipe_client *cli, status = cli->dispatch(cli, mem_ctx, - &ndr_table_wbint, + NDR_WBINT_UUID, NDR_WBINT_VERSION, NDR_WBINT_SID2GID, &r); @@ -800,7 +800,7 @@ struct tevent_req *rpccli_wbint_Uid2Sid_send(TALLOC_CTX *mem_ctx, state->tmp = state->orig; subreq = cli->dispatch_send(state, ev, cli, - &ndr_table_wbint, + NDR_WBINT_UUID, NDR_WBINT_VERSION, NDR_WBINT_UID2SID, &state->tmp); if (tevent_req_nomem(subreq, req)) { @@ -882,7 +882,7 @@ NTSTATUS rpccli_wbint_Uid2Sid(struct rpc_pipe_client *cli, status = cli->dispatch(cli, mem_ctx, - &ndr_table_wbint, + NDR_WBINT_UUID, NDR_WBINT_VERSION, NDR_WBINT_UID2SID, &r); @@ -949,7 +949,7 @@ struct tevent_req *rpccli_wbint_Gid2Sid_send(TALLOC_CTX *mem_ctx, state->tmp = state->orig; subreq = cli->dispatch_send(state, ev, cli, - &ndr_table_wbint, + NDR_WBINT_UUID, NDR_WBINT_VERSION, NDR_WBINT_GID2SID, &state->tmp); if (tevent_req_nomem(subreq, req)) { @@ -1031,7 +1031,7 @@ NTSTATUS rpccli_wbint_Gid2Sid(struct rpc_pipe_client *cli, status = cli->dispatch(cli, mem_ctx, - &ndr_table_wbint, + NDR_WBINT_UUID, NDR_WBINT_VERSION, NDR_WBINT_GID2SID, &r); @@ -1094,7 +1094,7 @@ struct tevent_req *rpccli_wbint_AllocateUid_send(TALLOC_CTX *mem_ctx, state->tmp = state->orig; subreq = cli->dispatch_send(state, ev, cli, - &ndr_table_wbint, + NDR_WBINT_UUID, NDR_WBINT_VERSION, NDR_WBINT_ALLOCATEUID, &state->tmp); if (tevent_req_nomem(subreq, req)) { @@ -1172,7 +1172,7 @@ NTSTATUS rpccli_wbint_AllocateUid(struct rpc_pipe_client *cli, status = cli->dispatch(cli, mem_ctx, - &ndr_table_wbint, + NDR_WBINT_UUID, NDR_WBINT_VERSION, NDR_WBINT_ALLOCATEUID, &r); @@ -1235,7 +1235,7 @@ struct tevent_req *rpccli_wbint_AllocateGid_send(TALLOC_CTX *mem_ctx, state->tmp = state->orig; subreq = cli->dispatch_send(state, ev, cli, - &ndr_table_wbint, + NDR_WBINT_UUID, NDR_WBINT_VERSION, NDR_WBINT_ALLOCATEGID, &state->tmp); if (tevent_req_nomem(subreq, req)) { @@ -1313,7 +1313,7 @@ NTSTATUS rpccli_wbint_AllocateGid(struct rpc_pipe_client *cli, status = cli->dispatch(cli, mem_ctx, - &ndr_table_wbint, + NDR_WBINT_UUID, NDR_WBINT_VERSION, NDR_WBINT_ALLOCATEGID, &r); @@ -1378,7 +1378,7 @@ struct tevent_req *rpccli_wbint_QueryUser_send(TALLOC_CTX *mem_ctx, state->tmp = state->orig; subreq = cli->dispatch_send(state, ev, cli, - &ndr_table_wbint, + NDR_WBINT_UUID, NDR_WBINT_VERSION, NDR_WBINT_QUERYUSER, &state->tmp); if (tevent_req_nomem(subreq, req)) { @@ -1458,7 +1458,7 @@ NTSTATUS rpccli_wbint_QueryUser(struct rpc_pipe_client *cli, status = cli->dispatch(cli, mem_ctx, - &ndr_table_wbint, + NDR_WBINT_UUID, NDR_WBINT_VERSION, NDR_WBINT_QUERYUSER, &r); @@ -1523,7 +1523,7 @@ struct tevent_req *rpccli_wbint_LookupUserAliases_send(TALLOC_CTX *mem_ctx, state->tmp = state->orig; subreq = cli->dispatch_send(state, ev, cli, - &ndr_table_wbint, + NDR_WBINT_UUID, NDR_WBINT_VERSION, NDR_WBINT_LOOKUPUSERALIASES, &state->tmp); if (tevent_req_nomem(subreq, req)) { @@ -1603,7 +1603,7 @@ NTSTATUS rpccli_wbint_LookupUserAliases(struct rpc_pipe_client *cli, status = cli->dispatch(cli, mem_ctx, - &ndr_table_wbint, + NDR_WBINT_UUID, NDR_WBINT_VERSION, NDR_WBINT_LOOKUPUSERALIASES, &r); @@ -1668,7 +1668,7 @@ struct tevent_req *rpccli_wbint_LookupUserGroups_send(TALLOC_CTX *mem_ctx, state->tmp = state->orig; subreq = cli->dispatch_send(state, ev, cli, - &ndr_table_wbint, + NDR_WBINT_UUID, NDR_WBINT_VERSION, NDR_WBINT_LOOKUPUSERGROUPS, &state->tmp); if (tevent_req_nomem(subreq, req)) { @@ -1748,7 +1748,7 @@ NTSTATUS rpccli_wbint_LookupUserGroups(struct rpc_pipe_client *cli, status = cli->dispatch(cli, mem_ctx, - &ndr_table_wbint, + NDR_WBINT_UUID, NDR_WBINT_VERSION, NDR_WBINT_LOOKUPUSERGROUPS, &r); @@ -1811,7 +1811,7 @@ struct tevent_req *rpccli_wbint_QuerySequenceNumber_send(TALLOC_CTX *mem_ctx, state->tmp = state->orig; subreq = cli->dispatch_send(state, ev, cli, - &ndr_table_wbint, + NDR_WBINT_UUID, NDR_WBINT_VERSION, NDR_WBINT_QUERYSEQUENCENUMBER, &state->tmp); if (tevent_req_nomem(subreq, req)) { @@ -1889,7 +1889,7 @@ NTSTATUS rpccli_wbint_QuerySequenceNumber(struct rpc_pipe_client *cli, status = cli->dispatch(cli, mem_ctx, - &ndr_table_wbint, + NDR_WBINT_UUID, NDR_WBINT_VERSION, NDR_WBINT_QUERYSEQUENCENUMBER, &r); @@ -1956,7 +1956,7 @@ struct tevent_req *rpccli_wbint_LookupGroupMembers_send(TALLOC_CTX *mem_ctx, state->tmp = state->orig; subreq = cli->dispatch_send(state, ev, cli, - &ndr_table_wbint, + NDR_WBINT_UUID, NDR_WBINT_VERSION, NDR_WBINT_LOOKUPGROUPMEMBERS, &state->tmp); if (tevent_req_nomem(subreq, req)) { @@ -2038,7 +2038,7 @@ NTSTATUS rpccli_wbint_LookupGroupMembers(struct rpc_pipe_client *cli, status = cli->dispatch(cli, mem_ctx, - &ndr_table_wbint, + NDR_WBINT_UUID, NDR_WBINT_VERSION, NDR_WBINT_LOOKUPGROUPMEMBERS, &r); @@ -2101,7 +2101,7 @@ struct tevent_req *rpccli_wbint_QueryUserList_send(TALLOC_CTX *mem_ctx, state->tmp = state->orig; subreq = cli->dispatch_send(state, ev, cli, - &ndr_table_wbint, + NDR_WBINT_UUID, NDR_WBINT_VERSION, NDR_WBINT_QUERYUSERLIST, &state->tmp); if (tevent_req_nomem(subreq, req)) { @@ -2179,7 +2179,7 @@ NTSTATUS rpccli_wbint_QueryUserList(struct rpc_pipe_client *cli, status = cli->dispatch(cli, mem_ctx, - &ndr_table_wbint, + NDR_WBINT_UUID, NDR_WBINT_VERSION, NDR_WBINT_QUERYUSERLIST, &r); @@ -2242,7 +2242,7 @@ struct tevent_req *rpccli_wbint_QueryGroupList_send(TALLOC_CTX *mem_ctx, state->tmp = state->orig; subreq = cli->dispatch_send(state, ev, cli, - &ndr_table_wbint, + NDR_WBINT_UUID, NDR_WBINT_VERSION, NDR_WBINT_QUERYGROUPLIST, &state->tmp); if (tevent_req_nomem(subreq, req)) { @@ -2320,7 +2320,7 @@ NTSTATUS rpccli_wbint_QueryGroupList(struct rpc_pipe_client *cli, status = cli->dispatch(cli, mem_ctx, - &ndr_table_wbint, + NDR_WBINT_UUID, NDR_WBINT_VERSION, NDR_WBINT_QUERYGROUPLIST, &r); @@ -2391,7 +2391,7 @@ struct tevent_req *rpccli_wbint_DsGetDcName_send(TALLOC_CTX *mem_ctx, state->tmp = state->orig; subreq = cli->dispatch_send(state, ev, cli, - &ndr_table_wbint, + NDR_WBINT_UUID, NDR_WBINT_VERSION, NDR_WBINT_DSGETDCNAME, &state->tmp); if (tevent_req_nomem(subreq, req)) { @@ -2477,7 +2477,7 @@ NTSTATUS rpccli_wbint_DsGetDcName(struct rpc_pipe_client *cli, status = cli->dispatch(cli, mem_ctx, - &ndr_table_wbint, + NDR_WBINT_UUID, NDR_WBINT_VERSION, NDR_WBINT_DSGETDCNAME, &r); @@ -2542,7 +2542,7 @@ struct tevent_req *rpccli_wbint_LookupRids_send(TALLOC_CTX *mem_ctx, state->tmp = state->orig; subreq = cli->dispatch_send(state, ev, cli, - &ndr_table_wbint, + NDR_WBINT_UUID, NDR_WBINT_VERSION, NDR_WBINT_LOOKUPRIDS, &state->tmp); if (tevent_req_nomem(subreq, req)) { @@ -2622,7 +2622,7 @@ NTSTATUS rpccli_wbint_LookupRids(struct rpc_pipe_client *cli, status = cli->dispatch(cli, mem_ctx, - &ndr_table_wbint, + NDR_WBINT_UUID, NDR_WBINT_VERSION, NDR_WBINT_LOOKUPRIDS, &r); @@ -2677,7 +2677,7 @@ struct tevent_req *rpccli_wbint_CheckMachineAccount_send(TALLOC_CTX *mem_ctx, state->tmp = state->orig; subreq = cli->dispatch_send(state, ev, cli, - &ndr_table_wbint, + NDR_WBINT_UUID, NDR_WBINT_VERSION, NDR_WBINT_CHECKMACHINEACCOUNT, &state->tmp); if (tevent_req_nomem(subreq, req)) { @@ -2753,7 +2753,7 @@ NTSTATUS rpccli_wbint_CheckMachineAccount(struct rpc_pipe_client *cli, status = cli->dispatch(cli, mem_ctx, - &ndr_table_wbint, + NDR_WBINT_UUID, NDR_WBINT_VERSION, NDR_WBINT_CHECKMACHINEACCOUNT, &r); @@ -2807,7 +2807,7 @@ struct tevent_req *rpccli_wbint_ChangeMachineAccount_send(TALLOC_CTX *mem_ctx, state->tmp = state->orig; subreq = cli->dispatch_send(state, ev, cli, - &ndr_table_wbint, + NDR_WBINT_UUID, NDR_WBINT_VERSION, NDR_WBINT_CHANGEMACHINEACCOUNT, &state->tmp); if (tevent_req_nomem(subreq, req)) { @@ -2883,7 +2883,7 @@ NTSTATUS rpccli_wbint_ChangeMachineAccount(struct rpc_pipe_client *cli, status = cli->dispatch(cli, mem_ctx, - &ndr_table_wbint, + NDR_WBINT_UUID, NDR_WBINT_VERSION, NDR_WBINT_CHANGEMACHINEACCOUNT, &r); @@ -2943,7 +2943,7 @@ struct tevent_req *rpccli_wbint_SetMapping_send(TALLOC_CTX *mem_ctx, state->tmp = state->orig; subreq = cli->dispatch_send(state, ev, cli, - &ndr_table_wbint, + NDR_WBINT_UUID, NDR_WBINT_VERSION, NDR_WBINT_SETMAPPING, &state->tmp); if (tevent_req_nomem(subreq, req)) { @@ -3025,7 +3025,7 @@ NTSTATUS rpccli_wbint_SetMapping(struct rpc_pipe_client *cli, status = cli->dispatch(cli, mem_ctx, - &ndr_table_wbint, + NDR_WBINT_UUID, NDR_WBINT_VERSION, NDR_WBINT_SETMAPPING, &r); @@ -3085,7 +3085,7 @@ struct tevent_req *rpccli_wbint_RemoveMapping_send(TALLOC_CTX *mem_ctx, state->tmp = state->orig; subreq = cli->dispatch_send(state, ev, cli, - &ndr_table_wbint, + NDR_WBINT_UUID, NDR_WBINT_VERSION, NDR_WBINT_REMOVEMAPPING, &state->tmp); if (tevent_req_nomem(subreq, req)) { @@ -3167,7 +3167,7 @@ NTSTATUS rpccli_wbint_RemoveMapping(struct rpc_pipe_client *cli, status = cli->dispatch(cli, mem_ctx, - &ndr_table_wbint, + NDR_WBINT_UUID, NDR_WBINT_VERSION, NDR_WBINT_REMOVEMAPPING, &r); @@ -3225,7 +3225,7 @@ struct tevent_req *rpccli_wbint_SetHWM_send(TALLOC_CTX *mem_ctx, state->tmp = state->orig; subreq = cli->dispatch_send(state, ev, cli, - &ndr_table_wbint, + NDR_WBINT_UUID, NDR_WBINT_VERSION, NDR_WBINT_SETHWM, &state->tmp); if (tevent_req_nomem(subreq, req)) { @@ -3305,7 +3305,7 @@ NTSTATUS rpccli_wbint_SetHWM(struct rpc_pipe_client *cli, status = cli->dispatch(cli, mem_ctx, - &ndr_table_wbint, + NDR_WBINT_UUID, NDR_WBINT_VERSION, NDR_WBINT_SETHWM, &r); diff --git a/source3/librpc/gen_ndr/srv_wbint.c b/source3/librpc/gen_ndr/srv_wbint.c index 0f39cd93e1..08a346a3f6 100644 --- a/source3/librpc/gen_ndr/srv_wbint.c +++ b/source3/librpc/gen_ndr/srv_wbint.c @@ -1864,7 +1864,7 @@ void wbint_get_pipe_fns(struct api_struct **fns, int *n_fns) *n_fns = sizeof(api_wbint_cmds) / sizeof(struct api_struct); } -NTSTATUS rpc_wbint_dispatch(struct rpc_pipe_client *cli, TALLOC_CTX *mem_ctx, const struct ndr_interface_table *table, uint32_t opnum, void *_r) +NTSTATUS rpc_wbint_dispatch(struct rpc_pipe_client *cli, TALLOC_CTX *mem_ctx, const char *interface, uint32_t interface_version, uint32_t opnum, void *_r) { if (cli->pipes_struct == NULL) { return NT_STATUS_INVALID_PARAMETER; diff --git a/source3/librpc/gen_ndr/srv_wbint.h b/source3/librpc/gen_ndr/srv_wbint.h index c8c04fb3cc..1e7f15ecec 100644 --- a/source3/librpc/gen_ndr/srv_wbint.h +++ b/source3/librpc/gen_ndr/srv_wbint.h @@ -25,7 +25,7 @@ NTSTATUS _wbint_SetMapping(pipes_struct *p, struct wbint_SetMapping *r); NTSTATUS _wbint_RemoveMapping(pipes_struct *p, struct wbint_RemoveMapping *r); NTSTATUS _wbint_SetHWM(pipes_struct *p, struct wbint_SetHWM *r); void wbint_get_pipe_fns(struct api_struct **fns, int *n_fns); -NTSTATUS rpc_wbint_dispatch(struct rpc_pipe_client *cli, TALLOC_CTX *mem_ctx, const struct ndr_interface_table *table, uint32_t opnum, void *r); +NTSTATUS rpc_wbint_dispatch(struct rpc_pipe_client *cli, TALLOC_CTX *mem_ctx, const char *interface, uint32_t interface_version, uint32_t opnum, void *r); void _wbint_Ping(pipes_struct *p, struct wbint_Ping *r); NTSTATUS _wbint_LookupSid(pipes_struct *p, struct wbint_LookupSid *r); NTSTATUS _wbint_LookupName(pipes_struct *p, struct wbint_LookupName *r); diff --git a/source3/rpc_client/ndr.c b/source3/rpc_client/ndr.c index 6433a7d196..1db6ff7290 100644 --- a/source3/rpc_client/ndr.c +++ b/source3/rpc_client/ndr.c @@ -33,12 +33,15 @@ static void cli_do_rpc_ndr_done(struct tevent_req *subreq); struct tevent_req *cli_do_rpc_ndr_send(TALLOC_CTX *mem_ctx, struct tevent_context *ev, struct rpc_pipe_client *cli, - const struct ndr_interface_table *table, + const char *interface, + uint32_t interface_version, uint32_t opnum, void *r) { struct tevent_req *req, *subreq; struct cli_do_rpc_ndr_state *state; + struct ndr_syntax_id syntax; + const struct ndr_interface_table *table; struct ndr_push *push; DATA_BLOB blob; enum ndr_err_code ndr_err; @@ -50,6 +53,17 @@ struct tevent_req *cli_do_rpc_ndr_send(TALLOC_CTX *mem_ctx, return NULL; } + if (!ndr_syntax_from_string(interface, interface_version, &syntax)) { + tevent_req_nterror(req, NT_STATUS_INVALID_PARAMETER); + return tevent_req_post(req, ev); + } + + table = get_iface_from_syntax(&syntax); + if (table == NULL) { + tevent_req_nterror(req, NT_STATUS_INVALID_PARAMETER); + return tevent_req_post(req, ev); + } + if (!ndr_syntax_id_equal(&table->syntax_id, &cli->abstract_syntax) || (opnum >= table->num_calls)) { tevent_req_nterror(req, NT_STATUS_INVALID_PARAMETER); @@ -156,7 +170,7 @@ NTSTATUS cli_do_rpc_ndr_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx) NTSTATUS cli_do_rpc_ndr(struct rpc_pipe_client *cli, TALLOC_CTX *mem_ctx, - const struct ndr_interface_table *table, + const char *interface, uint32_t interface_version, uint32_t opnum, void *r) { TALLOC_CTX *frame = talloc_stackframe(); @@ -170,7 +184,8 @@ NTSTATUS cli_do_rpc_ndr(struct rpc_pipe_client *cli, goto fail; } - req = cli_do_rpc_ndr_send(frame, ev, cli, table, opnum, r); + req = cli_do_rpc_ndr_send(frame, ev, cli, interface, interface_version, + opnum, r); if (req == NULL) { status = NT_STATUS_NO_MEMORY; goto fail; diff --git a/source3/rpc_server/srv_pipe_hnd.c b/source3/rpc_server/srv_pipe_hnd.c index 5d5eb0eeb1..254241c743 100644 --- a/source3/rpc_server/srv_pipe_hnd.c +++ b/source3/rpc_server/srv_pipe_hnd.c @@ -1464,7 +1464,8 @@ NTSTATUS rpc_pipe_open_internal(TALLOC_CTX *mem_ctx, const struct ndr_syntax_id *abstract_syntax, NTSTATUS (*dispatch) (struct rpc_pipe_client *cli, TALLOC_CTX *mem_ctx, - const struct ndr_interface_table *table, + const char *interface, + uint32_t interface_version, uint32_t opnum, void *r), struct auth_serversupplied_info *serversupplied_info, struct rpc_pipe_client **presult) diff --git a/source3/winbindd/winbindd_dual_ndr.c b/source3/winbindd/winbindd_dual_ndr.c index 8a23ce48e0..eb018aa87e 100644 --- a/source3/winbindd/winbindd_dual_ndr.c +++ b/source3/winbindd/winbindd_dual_ndr.c @@ -51,7 +51,8 @@ static void wb_ndr_dispatch_done(struct tevent_req *subreq); static struct tevent_req *wb_ndr_dispatch_send(TALLOC_CTX *mem_ctx, struct tevent_context *ev, struct rpc_pipe_client *cli, - const struct ndr_interface_table *table, + const char *interface, + uint32_t interface_version, uint32_t opnum, void *r) { @@ -69,7 +70,7 @@ static struct tevent_req *wb_ndr_dispatch_send(TALLOC_CTX *mem_ctx, } state->r = r; - state->call = &table->calls[opnum]; + state->call = &ndr_table_wbint.calls[opnum]; state->transport = transport; state->opnum = opnum; @@ -167,7 +168,8 @@ static NTSTATUS wb_ndr_dispatch_recv(struct tevent_req *req, static NTSTATUS wb_ndr_dispatch(struct rpc_pipe_client *cli, TALLOC_CTX *mem_ctx, - const struct ndr_interface_table *table, + const char *interface, + uint32_t interface_version, uint32_t opnum, void *r) { TALLOC_CTX *frame = talloc_stackframe(); @@ -181,7 +183,8 @@ static NTSTATUS wb_ndr_dispatch(struct rpc_pipe_client *cli, goto fail; } - req = wb_ndr_dispatch_send(frame, ev, cli, table, opnum, r); + req = wb_ndr_dispatch_send(frame, ev, cli, interface, + interface_version, opnum, r); if (req == NULL) { status = NT_STATUS_NO_MEMORY; goto fail; |