From 5a849c13a7100fe5c3a84386988b0910608b3ece Mon Sep 17 00:00:00 2001 From: Stefan Metzmacher Date: Thu, 16 Jan 2014 07:17:00 +0100 Subject: [PATCH] s4:torture/samba3rpc: move pipe_bind_smb() to the top Signed-off-by: Stefan Metzmacher Reviewed-by: Guenther Deschner --- source4/torture/rpc/samba3rpc.c | 74 ++++++++++++++++++++--------------------- 1 file changed, 37 insertions(+), 37 deletions(-) diff --git a/source4/torture/rpc/samba3rpc.c b/source4/torture/rpc/samba3rpc.c index 6f5477ff08e..6d444f2c30f 100644 --- a/source4/torture/rpc/samba3rpc.c +++ b/source4/torture/rpc/samba3rpc.c @@ -49,6 +49,43 @@ #include "libcli/smb/smbXcli_base.h" /* + * open pipe and bind, given an IPC$ context + */ + +static NTSTATUS pipe_bind_smb(struct torture_context *tctx, + TALLOC_CTX *mem_ctx, + struct smbcli_tree *tree, + const char *pipe_name, + const struct ndr_interface_table *iface, + struct dcerpc_pipe **p) +{ + struct dcerpc_pipe *result; + NTSTATUS status; + + if (!(result = dcerpc_pipe_init(mem_ctx, tctx->ev))) { + return NT_STATUS_NO_MEMORY; + } + + status = dcerpc_pipe_open_smb(result, tree, pipe_name); + if (!NT_STATUS_IS_OK(status)) { + torture_comment(tctx, "dcerpc_pipe_open_smb failed: %s\n", + nt_errstr(status)); + talloc_free(result); + return status; + } + + status = dcerpc_bind_auth_none(result, iface); + if (!NT_STATUS_IS_OK(status)) { + torture_comment(tctx, "dcerpc_bind_auth_none failed: %s\n", nt_errstr(status)); + talloc_free(result); + return status; + } + + *p = result; + return NT_STATUS_OK; +} + +/* * This tests a RPC call using an invalid vuid */ @@ -1515,43 +1552,6 @@ static bool torture_samba3_sessionkey(struct torture_context *torture) } /* - * open pipe and bind, given an IPC$ context - */ - -static NTSTATUS pipe_bind_smb(struct torture_context *tctx, - TALLOC_CTX *mem_ctx, - struct smbcli_tree *tree, - const char *pipe_name, - const struct ndr_interface_table *iface, - struct dcerpc_pipe **p) -{ - struct dcerpc_pipe *result; - NTSTATUS status; - - if (!(result = dcerpc_pipe_init(mem_ctx, tctx->ev))) { - return NT_STATUS_NO_MEMORY; - } - - status = dcerpc_pipe_open_smb(result, tree, pipe_name); - if (!NT_STATUS_IS_OK(status)) { - torture_comment(tctx, "dcerpc_pipe_open_smb failed: %s\n", - nt_errstr(status)); - talloc_free(result); - return status; - } - - status = dcerpc_bind_auth_none(result, iface); - if (!NT_STATUS_IS_OK(status)) { - torture_comment(tctx, "schannel bind failed: %s\n", nt_errstr(status)); - talloc_free(result); - return status; - } - - *p = result; - return NT_STATUS_OK; -} - -/* * Sane wrapper around lsa_LookupNames */ -- 2.11.4.GIT