From 18b8928c8cb12d2f56efcc61df5b74db3caec29c Mon Sep 17 00:00:00 2001 From: =?utf8?q?G=C3=BCnther=20Deschner?= Date: Tue, 4 Nov 2008 18:40:24 +0100 Subject: [PATCH] s3-rpc_client: add cli_rpc_pipe_open_noauth_transport. Guenther (cherry picked from commit 87f61a144b8d25c90b847940ca03ced1f77b036c) --- source3/include/proto.h | 4 ++++ source3/rpc_client/cli_pipe.c | 40 ++++++++++++++++++++++++++-------------- 2 files changed, 30 insertions(+), 14 deletions(-) diff --git a/source3/include/proto.h b/source3/include/proto.h index 802c2ed082d..910b49ec9ec 100644 --- a/source3/include/proto.h +++ b/source3/include/proto.h @@ -5289,6 +5289,10 @@ NTSTATUS rpc_pipe_open_internal(TALLOC_CTX *mem_ctx, const struct ndr_syntax_id NTSTATUS cli_rpc_pipe_open_noauth(struct cli_state *cli, const struct ndr_syntax_id *interface, struct rpc_pipe_client **presult); +NTSTATUS cli_rpc_pipe_open_noauth_transport(struct cli_state *cli, + enum dcerpc_transport_t transport, + const struct ndr_syntax_id *interface, + struct rpc_pipe_client **presult); NTSTATUS cli_rpc_pipe_open_ntlmssp(struct cli_state *cli, const struct ndr_syntax_id *interface, enum pipe_auth_level auth_level, diff --git a/source3/rpc_client/cli_pipe.c b/source3/rpc_client/cli_pipe.c index 12d2b9e5432..75ce7cb32bc 100644 --- a/source3/rpc_client/cli_pipe.c +++ b/source3/rpc_client/cli_pipe.c @@ -3598,34 +3598,35 @@ NTSTATUS rpc_pipe_open_local(TALLOC_CTX *mem_ctx, ****************************************************************************/ static NTSTATUS cli_rpc_pipe_open(struct cli_state *cli, + enum dcerpc_transport_t transport, const struct ndr_syntax_id *interface, struct rpc_pipe_client **presult) { - if (ndr_syntax_id_equal(interface, &ndr_table_drsuapi.syntax_id)) { - /* - * We should have a better way to figure out this drsuapi - * speciality... - */ + switch (transport) { + case NCACN_IP_TCP: return rpc_pipe_open_tcp(NULL, cli->desthost, interface, presult); + case NCACN_NP: + return rpc_pipe_open_np(cli, interface, presult); + default: + return NT_STATUS_NOT_IMPLEMENTED; } - - return rpc_pipe_open_np(cli, interface, presult); } /**************************************************************************** Open a named pipe to an SMB server and bind anonymously. ****************************************************************************/ -NTSTATUS cli_rpc_pipe_open_noauth(struct cli_state *cli, - const struct ndr_syntax_id *interface, - struct rpc_pipe_client **presult) +NTSTATUS cli_rpc_pipe_open_noauth_transport(struct cli_state *cli, + enum dcerpc_transport_t transport, + const struct ndr_syntax_id *interface, + struct rpc_pipe_client **presult) { struct rpc_pipe_client *result; struct cli_pipe_auth_data *auth; NTSTATUS status; - status = cli_rpc_pipe_open(cli, interface, &result); + status = cli_rpc_pipe_open(cli, transport, interface, &result); if (!NT_STATUS_IS_OK(status)) { return status; } @@ -3684,6 +3685,17 @@ NTSTATUS cli_rpc_pipe_open_noauth(struct cli_state *cli, } /**************************************************************************** + ****************************************************************************/ + +NTSTATUS cli_rpc_pipe_open_noauth(struct cli_state *cli, + const struct ndr_syntax_id *interface, + struct rpc_pipe_client **presult) +{ + return cli_rpc_pipe_open_noauth_transport(cli, NCACN_NP, + interface, presult); +} + +/**************************************************************************** Open a named pipe to an SMB server and bind using NTLMSSP or SPNEGO NTLMSSP ****************************************************************************/ @@ -3700,7 +3712,7 @@ static NTSTATUS cli_rpc_pipe_open_ntlmssp_internal(struct cli_state *cli, struct cli_pipe_auth_data *auth; NTSTATUS status; - status = cli_rpc_pipe_open(cli, interface, &result); + status = cli_rpc_pipe_open(cli, NCACN_NP, interface, &result); if (!NT_STATUS_IS_OK(status)) { return status; } @@ -3879,7 +3891,7 @@ NTSTATUS cli_rpc_pipe_open_schannel_with_key(struct cli_state *cli, struct cli_pipe_auth_data *auth; NTSTATUS status; - status = cli_rpc_pipe_open(cli, interface, &result); + status = cli_rpc_pipe_open(cli, NCACN_NP, interface, &result); if (!NT_STATUS_IS_OK(status)) { return status; } @@ -4055,7 +4067,7 @@ NTSTATUS cli_rpc_pipe_open_krb5(struct cli_state *cli, struct cli_pipe_auth_data *auth; NTSTATUS status; - status = cli_rpc_pipe_open(cli, interface, &result); + status = cli_rpc_pipe_open(cli, NCACN_NP, interface, &result); if (!NT_STATUS_IS_OK(status)) { return status; } -- 2.11.4.GIT