From 7befc0648e4366980b7efdf31cc946ea11de5101 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Mon, 24 Nov 2003 12:40:47 +0000 Subject: initial implementation of dcerpc over tcp. RPC-EPMAPPER works, now to add epm_Map calls and support the rest of the pipes (This used to be commit 39add481582609ddb9d0b3bae45fde3226ece481) --- source4/torture/rpc/epmapper.c | 8 ++++---- source4/torture/torture.c | 24 ++++++++++++++++++++++++ 2 files changed, 28 insertions(+), 4 deletions(-) (limited to 'source4/torture') diff --git a/source4/torture/rpc/epmapper.c b/source4/torture/rpc/epmapper.c index de3b0b67d2..a056f2254e 100644 --- a/source4/torture/rpc/epmapper.c +++ b/source4/torture/rpc/epmapper.c @@ -179,10 +179,10 @@ BOOL torture_rpc_epmapper(int dummy) mem_ctx = talloc_init("torture_rpc_epmapper"); - status = torture_rpc_connection(&p, - DCERPC_EPMAPPER_NAME, - DCERPC_EPMAPPER_UUID, - DCERPC_EPMAPPER_VERSION); + status = torture_rpc_tcp(&p, + DCERPC_EPMAPPER_NAME, + DCERPC_EPMAPPER_UUID, + DCERPC_EPMAPPER_VERSION); if (!NT_STATUS_IS_OK(status)) { return False; } diff --git a/source4/torture/torture.c b/source4/torture/torture.c index c07b516baa..73373d944c 100644 --- a/source4/torture/torture.c +++ b/source4/torture/torture.c @@ -157,6 +157,30 @@ NTSTATUS torture_rpc_connection(struct dcerpc_pipe **p, return status; } +/* open a rpc connection to a named pipe */ +NTSTATUS torture_rpc_tcp(struct dcerpc_pipe **p, + const char *pipe_name, + const char *pipe_uuid, + uint32 pipe_version) +{ + NTSTATUS status; + + status = dcerpc_pipe_open_tcp(p, + lp_parm_string(-1, "torture", "host"), + lp_parm_int(-1, "torture", "share"), + pipe_uuid, pipe_version); + if (!NT_STATUS_IS_OK(status)) { + printf("Open of pipe '%s' failed with error (%s)\n", + pipe_name, nt_errstr(status)); + return status; + } + + /* always do NDR validation in smbtorture */ + (*p)->flags |= DCERPC_DEBUG_VALIDATE_BOTH; + + return status; +} + /* close a rpc connection to a named pipe */ NTSTATUS torture_rpc_close(struct dcerpc_pipe *p) { -- cgit