summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGünther Deschner <gd@samba.org>2008-11-04 18:40:24 +0100
committerGünther Deschner <gd@samba.org>2009-09-11 09:59:03 +0200
commit87f61a144b8d25c90b847940ca03ced1f77b036c (patch)
tree9a5d2c6e678133c092074bc609cc8a3ca1bf2235
parentf009fa15a17d29e41e04eb950bafaea084d2c31d (diff)
downloadsamba-87f61a144b8d25c90b847940ca03ced1f77b036c.tar.gz
samba-87f61a144b8d25c90b847940ca03ced1f77b036c.tar.bz2
samba-87f61a144b8d25c90b847940ca03ced1f77b036c.zip
s3-rpc_client: add cli_rpc_pipe_open_noauth_transport.
Guenther
-rw-r--r--source3/include/proto.h4
-rw-r--r--source3/rpc_client/cli_pipe.c40
2 files changed, 30 insertions, 14 deletions
diff --git a/source3/include/proto.h b/source3/include/proto.h
index 865abbf910..ddb8dddbed 100644
--- a/source3/include/proto.h
+++ b/source3/include/proto.h
@@ -5311,6 +5311,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 0c3fc946d4..7aaee413f9 100644
--- a/source3/rpc_client/cli_pipe.c
+++ b/source3/rpc_client/cli_pipe.c
@@ -3597,34 +3597,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;
}
@@ -3683,6 +3684,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
****************************************************************************/
@@ -3699,7 +3711,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;
}
@@ -3880,7 +3892,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;
}
@@ -4056,7 +4068,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;
}