From 62a2cf0033eec42dc8bf4e36fec1031c614ce35b 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) (cherry picked from commit c968714f7910ba90c2e989e46d18c265d9f9b549) --- source/include/proto.h | 4 ++++ source/rpc_client/cli_pipe.c | 40 ++++++++++++++++++++++++++-------------- 2 files changed, 30 insertions(+), 14 deletions(-) diff --git a/source/include/proto.h b/source/include/proto.h index ec8637b6a66..42fb7aa7c1a 100644 --- a/source/include/proto.h +++ b/source/include/proto.h @@ -6988,6 +6988,10 @@ NTSTATUS rpc_pipe_open_ncalrpc(TALLOC_CTX *mem_ctx, const char *socket_path, 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/source/rpc_client/cli_pipe.c b/source/rpc_client/cli_pipe.c index 2e2767b4707..507ada3744a 100644 --- a/source/rpc_client/cli_pipe.c +++ b/source/rpc_client/cli_pipe.c @@ -2931,34 +2931,35 @@ static NTSTATUS rpc_pipe_open_np(struct cli_state *cli, ****************************************************************************/ 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; } @@ -3015,6 +3016,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 ****************************************************************************/ @@ -3031,7 +3043,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; } @@ -3210,7 +3222,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; } @@ -3386,7 +3398,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