From 870a06aadd56d8c9a88e0d2392afe28bd082d1ec Mon Sep 17 00:00:00 2001 From: Stefan Metzmacher Date: Thu, 30 Jan 2014 19:06:28 +0100 Subject: [PATCH] s4:torture/rpc: make use of dcerpc_binding_set_*() in torture_rpc_connection_transport() Signed-off-by: Stefan Metzmacher Reviewed-by: Guenther Deschner --- source4/torture/rpc/rpc.c | 25 ++++++++++++++++++------- 1 file changed, 18 insertions(+), 7 deletions(-) diff --git a/source4/torture/rpc/rpc.c b/source4/torture/rpc/rpc.c index 2ec55b68ead..0e27a6e8646 100644 --- a/source4/torture/rpc/rpc.c +++ b/source4/torture/rpc/rpc.c @@ -105,21 +105,32 @@ NTSTATUS torture_rpc_connection_transport(struct torture_context *tctx, NTSTATUS status; struct dcerpc_binding *binding; + *p = NULL; + status = torture_rpc_binding(tctx, &binding); - if (NT_STATUS_IS_ERR(status)) + if (!NT_STATUS_IS_OK(status)) { return status; + } - binding->transport = transport; - binding->assoc_group_id = assoc_group_id; + status = dcerpc_binding_set_transport(binding, transport); + if (!NT_STATUS_IS_OK(status)) { + return status; + } + + status = dcerpc_binding_set_assoc_group_id(binding, assoc_group_id); + if (!NT_STATUS_IS_OK(status)) { + return status; + } status = dcerpc_pipe_connect_b(tctx, p, binding, table, - cmdline_credentials, tctx->ev, tctx->lp_ctx); - - if (NT_STATUS_IS_ERR(status)) { + cmdline_credentials, + tctx->ev, tctx->lp_ctx); + if (!NT_STATUS_IS_OK(status)) { *p = NULL; + return status; } - return status; + return NT_STATUS_OK; } static bool torture_rpc_setup_machine_workstation(struct torture_context *tctx, -- 2.11.4.GIT