diff options
author | Stefan Metzmacher <metze@samba.org> | 2014-01-16 07:20:20 +0100 |
---|---|---|
committer | Günther Deschner <gd@samba.org> | 2015-07-07 14:05:28 +0200 |
commit | 810d630bd5120f12540ce9ab09e106c41a028347 (patch) | |
tree | 52ce67b661e2d4972ebfda7251d6b9c7c3631db3 | |
parent | f42d4e9dd342f207b206f7cf00a75e690ded76ed (diff) | |
download | samba-810d630bd5120f12540ce9ab09e106c41a028347.tar.gz |
s4:torture/samba3rpc: add pipe_bind_smb_auth()
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Guenther Deschner <gd@samba.org>
-rw-r--r-- | source4/torture/rpc/samba3rpc.c | 38 |
1 files changed, 38 insertions, 0 deletions
diff --git a/source4/torture/rpc/samba3rpc.c b/source4/torture/rpc/samba3rpc.c index cfc5b4f217a..83cee633db4 100644 --- a/source4/torture/rpc/samba3rpc.c +++ b/source4/torture/rpc/samba3rpc.c @@ -118,6 +118,44 @@ static NTSTATUS pipe_bind_smb2(struct torture_context *tctx, return NT_STATUS_OK; } +static NTSTATUS pipe_bind_smb_auth(struct torture_context *tctx, + TALLOC_CTX *mem_ctx, + struct smbcli_tree *tree, + struct cli_credentials *creds, + uint8_t auth_type, + uint8_t auth_level, + 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(result, iface, creds, + lpcfg_gensec_settings(tctx->lp_ctx, tctx->lp_ctx), + auth_type, auth_level, NULL); + if (!NT_STATUS_IS_OK(status)) { + torture_comment(tctx, "dcerpc_bind_auth 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 */ |