From 1f348d077b25eb674c099c9b3a7776750b39f4a2 Mon Sep 17 00:00:00 2001 From: Stefan Metzmacher Date: Wed, 21 Nov 2018 19:08:59 +0100 Subject: [PATCH] s4:rpc_server/remote: remote_op_bind already has the table available BUG: https://bugzilla.samba.org/show_bug.cgi?id=7113 BUG: https://bugzilla.samba.org/show_bug.cgi?id=11892 Signed-off-by: Stefan Metzmacher Reviewed-by: Jeremy Allison --- source4/rpc_server/remote/dcesrv_remote.c | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/source4/rpc_server/remote/dcesrv_remote.c b/source4/rpc_server/remote/dcesrv_remote.c index 17177096c29..a3611adcb91 100644 --- a/source4/rpc_server/remote/dcesrv_remote.c +++ b/source4/rpc_server/remote/dcesrv_remote.c @@ -42,7 +42,8 @@ static NTSTATUS remote_op_reply(struct dcesrv_call_state *dce_call, TALLOC_CTX * static NTSTATUS remote_op_bind(struct dcesrv_call_state *dce_call, const struct dcesrv_interface *iface, uint32_t if_version) { NTSTATUS status; - const struct ndr_interface_table *table; + const struct ndr_interface_table *table = + (const struct ndr_interface_table *)dce_call->context->iface->private_data; struct dcesrv_remote_private *priv; const char *binding = lpcfg_parm_string(dce_call->conn->dce_ctx->lp_ctx, NULL, "dcerpc_remote", "binding"); const char *user, *pass, *domain; @@ -72,12 +73,6 @@ static NTSTATUS remote_op_bind(struct dcesrv_call_state *dce_call, const struct pass = lpcfg_parm_string(dce_call->conn->dce_ctx->lp_ctx, NULL, "dcerpc_remote", "password"); domain = lpcfg_parm_string(dce_call->conn->dce_ctx->lp_ctx, NULL, "dceprc_remote", "domain"); - table = ndr_table_by_syntax(&iface->syntax_id); - if (!table) { - dce_call->fault_code = DCERPC_NCA_S_UNKNOWN_IF; - return NT_STATUS_NET_WRITE_FAULT; - } - credentials = dcesrv_call_credentials(dce_call); if (user && pass) { @@ -133,7 +128,7 @@ static NTSTATUS remote_op_bind(struct dcesrv_call_state *dce_call, const struct } } - status = dcerpc_binding_set_abstract_syntax(b, &iface->syntax_id); + status = dcerpc_binding_set_abstract_syntax(b, &table->syntax_id); if (!NT_STATUS_IS_OK(status)) { DEBUG(0, ("dcerpc_binding_set_abstract_syntax() - %s'\n", nt_errstr(status))); -- 2.34.1