s4:torture/rpc: make use of dcerpc_binding_set_*() in torture_rpc_connection_transport()
authorStefan Metzmacher <metze@samba.org>
Thu, 30 Jan 2014 18:06:28 +0000 (19:06 +0100)
committerGünther Deschner <gd@samba.org>
Thu, 13 Feb 2014 10:54:15 +0000 (11:54 +0100)
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Guenther Deschner <gd@samba.org>
source4/torture/rpc/rpc.c

index 2ec55b68ead209d01731bc8936ab8a3a8c94a38b..0e27a6e8646cfc5c340eba00ad0be9eef48da823 100644 (file)
@@ -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,