summaryrefslogtreecommitdiffstats
path: root/source3/rpc_client
diff options
context:
space:
mode:
Diffstat (limited to 'source3/rpc_client')
-rw-r--r--source3/rpc_client/rpc_transport_np.c17
1 files changed, 16 insertions, 1 deletions
diff --git a/source3/rpc_client/rpc_transport_np.c b/source3/rpc_client/rpc_transport_np.c
index 961749436cb..9e0bebb5742 100644
--- a/source3/rpc_client/rpc_transport_np.c
+++ b/source3/rpc_client/rpc_transport_np.c
@@ -22,6 +22,8 @@
#include "rpc_client/rpc_transport.h"
#include "libsmb/cli_np_tstream.h"
#include "librpc/ndr/ndr_table.h"
+#include "libcli/smb/smbXcli_base.h"
+#include "client.h"
#undef DBGC_CLASS
#define DBGC_CLASS DBGC_RPC_CLI
@@ -41,6 +43,9 @@ struct tevent_req *rpc_transport_np_init_send(TALLOC_CTX *mem_ctx,
struct rpc_transport_np_init_state *state;
const char *pipe_name;
struct tevent_req *subreq;
+ struct smbXcli_session *session;
+ struct smbXcli_tcon *tcon;
+ uint16_t pid = 0;
req = tevent_req_create(mem_ctx, &state,
struct rpc_transport_np_init_state);
@@ -48,6 +53,15 @@ struct tevent_req *rpc_transport_np_init_send(TALLOC_CTX *mem_ctx,
return NULL;
}
+ if (smbXcli_conn_protocol(cli->conn) >= PROTOCOL_SMB2_02) {
+ tcon = cli->smb2.tcon;
+ session = cli->smb2.session;
+ } else {
+ tcon = cli->smb1.tcon;
+ session = cli->smb1.session;
+ pid = cli->smb1.pid;
+ }
+
pipe_name = dcerpc_default_transport_endpoint(mem_ctx, NCACN_NP, table);
if (tevent_req_nomem(pipe_name, req)) {
return tevent_req_post(req, ev);
@@ -57,7 +71,8 @@ struct tevent_req *rpc_transport_np_init_send(TALLOC_CTX *mem_ctx,
pipe_name++;
}
- subreq = tstream_cli_np_open_send(state, ev, cli, pipe_name);
+ subreq = tstream_cli_np_open_send(state, ev, cli->conn, session, tcon,
+ pid, cli->timeout, pipe_name);
if (tevent_req_nomem(subreq, req)) {
return tevent_req_post(req, ev);
}