summaryrefslogtreecommitdiff
path: root/source4
diff options
context:
space:
mode:
authorStefan Metzmacher <metze@samba.org>2014-01-16 07:19:26 +0100
committerGünther Deschner <gd@samba.org>2015-07-07 14:05:28 +0200
commit1df9416bdb9ce569618a94df4dbcdbb016b8f8a1 (patch)
treefdbacb6c91025f45898431ee93aecf7de36139a2 /source4
parentd80c38990fa8821cbda554aa18c19a50207172a9 (diff)
downloadsamba-1df9416bdb9ce569618a94df4dbcdbb016b8f8a1.tar.gz
s4:torture/samba3rpc: add pipe_bind_smb2()
Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Guenther Deschner <gd@samba.org>
Diffstat (limited to 'source4')
-rw-r--r--source4/torture/rpc/samba3rpc.c33
1 files changed, 33 insertions, 0 deletions
diff --git a/source4/torture/rpc/samba3rpc.c b/source4/torture/rpc/samba3rpc.c
index 6832940db4e..c5cb877b09d 100644
--- a/source4/torture/rpc/samba3rpc.c
+++ b/source4/torture/rpc/samba3rpc.c
@@ -85,6 +85,39 @@ static NTSTATUS pipe_bind_smb(struct torture_context *tctx,
return NT_STATUS_OK;
}
+static NTSTATUS pipe_bind_smb2(struct torture_context *tctx,
+ TALLOC_CTX *mem_ctx,
+ struct smb2_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_smb2(result, tree, pipe_name);
+ if (!NT_STATUS_IS_OK(status)) {
+ torture_comment(tctx, "dcerpc_pipe_open_smb2 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
*/