summaryrefslogtreecommitdiff
path: root/source4/librpc/rpc
diff options
context:
space:
mode:
authorRafal Szczesniak <mimir@samba.org>2005-12-01 22:43:30 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 13:46:57 -0500
commit3584f2cac1fab5555296efefb85b7aced36f0f14 (patch)
tree20b3ce0b55e7e105a26817c3d2c62a2040f599b2 /source4/librpc/rpc
parent6913dddf644525f4bdadfb740b5bff41abe030b2 (diff)
downloadsamba-3584f2cac1fab5555296efefb85b7aced36f0f14.tar.gz
samba-3584f2cac1fab5555296efefb85b7aced36f0f14.tar.bz2
samba-3584f2cac1fab5555296efefb85b7aced36f0f14.zip
r12001: Replace smbcli_full_connection call with composite connect used
in sync version. This step makes it easer to move further to async dcerpc connect routine. rafal (This used to be commit 87b016d55315190fa3f6083c75cb783ad45ddd0b)
Diffstat (limited to 'source4/librpc/rpc')
-rw-r--r--source4/librpc/rpc/dcerpc_util.c33
1 files changed, 25 insertions, 8 deletions
diff --git a/source4/librpc/rpc/dcerpc_util.c b/source4/librpc/rpc/dcerpc_util.c
index b21ab38b05..cfb92cf8ad 100644
--- a/source4/librpc/rpc/dcerpc_util.c
+++ b/source4/librpc/rpc/dcerpc_util.c
@@ -27,6 +27,8 @@
#include "librpc/gen_ndr/ndr_epmapper.h"
#include "librpc/gen_ndr/ndr_dcerpc.h"
#include "librpc/gen_ndr/ndr_misc.h"
+#include "libcli/raw/libcliraw.h"
+#include "libcli/smb_composite/smb_composite.h"
/*
find the pipe name for a local IDL interface
@@ -1023,29 +1025,44 @@ static NTSTATUS dcerpc_pipe_connect_ncacn_np_smb(TALLOC_CTX *tmp_ctx,
struct cli_credentials *credentials)
{
NTSTATUS status;
+ struct smb_composite_connect conn;
struct smbcli_state *cli;
const char *pipe_name = NULL;
+ conn.in.dest_host = binding->host;
+ conn.in.port = 0;
+ conn.in.called_name = strupper_talloc(tmp_ctx, binding->host);
+ conn.in.service = "IPC$";
+ conn.in.service_type = NULL;
+ conn.in.fallback_to_anonymous = False;
+ conn.in.workgroup = lp_workgroup();
+
if (binding->flags & DCERPC_SCHANNEL) {
struct cli_credentials *anon_creds
= cli_credentials_init(tmp_ctx);
cli_credentials_set_anonymous(anon_creds);
cli_credentials_guess(anon_creds);
- status = smbcli_full_connection(p->conn, &cli,
- binding->host,
- "IPC$", NULL,
- anon_creds, p->conn->event_ctx);
+
+ conn.in.credentials = anon_creds;
+ status = smb_composite_connect(&conn, p->conn, p->conn->event_ctx);
+
} else {
- status = smbcli_full_connection(p->conn, &cli,
- binding->host,
- "IPC$", NULL,
- credentials, p->conn->event_ctx);
+
+ conn.in.credentials = credentials;
+ status = smb_composite_connect(&conn, p->conn, p->conn->event_ctx);
+
}
+
if (!NT_STATUS_IS_OK(status)) {
DEBUG(0,("Failed to connect to %s - %s\n", binding->host, nt_errstr(status)));
return status;
}
+ cli = smbcli_state_init(p->conn);
+ cli->tree = conn.out.tree;
+ cli->session = conn.out.tree->session;
+ cli->transport = conn.out.tree->session->transport;
+
pipe_name = binding->endpoint;
status = dcerpc_pipe_open_smb(p->conn, cli->tree, pipe_name);