summaryrefslogtreecommitdiffstats
path: root/source4/librpc/rpc
diff options
context:
space:
mode:
authorStefan Metzmacher <metze@samba.org>2014-01-15 12:56:36 +0100
committerAndrew Bartlett <abartlet@samba.org>2014-05-26 03:31:28 +0200
commit7ea04759d7f94a5d4fa57a63612afd9e752ba5e9 (patch)
tree3adb817e92d2a06dcc59dc449acb0951faf73ade /source4/librpc/rpc
parentae406ac6687a5c093e196741ac0187cf27a83b3d (diff)
downloadsamba-7ea04759d7f94a5d4fa57a63612afd9e752ba5e9.tar.gz
samba-7ea04759d7f94a5d4fa57a63612afd9e752ba5e9.tar.xz
samba-7ea04759d7f94a5d4fa57a63612afd9e752ba5e9.zip
s4:librpc/rpc: remember some smbXcli_* pointers within struct dcerpc_pipe_connect
This will simplify further improvements. Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Diffstat (limited to 'source4/librpc/rpc')
-rw-r--r--source4/librpc/rpc/dcerpc_connect.c60
1 files changed, 27 insertions, 33 deletions
diff --git a/source4/librpc/rpc/dcerpc_connect.c b/source4/librpc/rpc/dcerpc_connect.c
index d9daa7dee25..7b1ed48db8c 100644
--- a/source4/librpc/rpc/dcerpc_connect.c
+++ b/source4/librpc/rpc/dcerpc_connect.c
@@ -39,13 +39,18 @@
struct dcerpc_pipe_connect {
struct dcecli_connection *conn;
struct dcerpc_binding *binding;
- const char *pipe_name;
const struct ndr_interface_table *interface;
struct cli_credentials *creds;
struct resolve_context *resolve_ctx;
struct {
const char *dir;
} ncalrpc;
+ struct {
+ struct smbXcli_conn *conn;
+ struct smbXcli_session *session;
+ struct smbXcli_tcon *tcon;
+ const char *pipe_name;
+ } smb;
};
struct pipe_np_smb_state {
@@ -81,32 +86,28 @@ static void continue_smb_connect(struct composite_context *ctx)
struct pipe_np_smb_state *s = talloc_get_type(c->private_data,
struct pipe_np_smb_state);
struct smbcli_tree *t;
- struct smbXcli_conn *conn;
- struct smbXcli_session *session;
- struct smbXcli_tcon *tcon;
/* receive result of smb connect request */
c->status = smb_composite_connect_recv(ctx, s->io.conn);
if (!composite_is_ok(c)) return;
- /* prepare named pipe open parameters */
- s->io.pipe_name = dcerpc_binding_get_string_option(s->io.binding, "endpoint");
- if (s->io.pipe_name == NULL) {
- composite_error(c, NT_STATUS_INVALID_PARAMETER_MIX);
- return;
- }
-
t = s->conn.out.tree;
- conn = t->session->transport->conn;
- session = t->session->smbXcli;
- tcon = t->smbXcli;
- smb1cli_tcon_set_id(tcon, t->tid);
+
+ /* prepare named pipe open parameters */
+ s->io.smb.conn = t->session->transport->conn;
+ s->io.smb.session = t->session->smbXcli;
+ s->io.smb.tcon = t->smbXcli;
+ smb1cli_tcon_set_id(s->io.smb.tcon, t->tid);
+ s->io.smb.pipe_name = dcerpc_binding_get_string_option(s->io.binding,
+ "endpoint");
/* send named pipe open request */
open_ctx = dcerpc_pipe_open_smb_send(s->io.conn,
- conn, session, tcon,
+ s->io.smb.conn,
+ s->io.smb.session,
+ s->io.smb.tcon,
DCERPC_REQUEST_TIMEOUT * 1000,
- s->io.pipe_name);
+ s->io.smb.pipe_name);
if (composite_nomem(open_ctx, c)) return;
composite_continue(c, open_ctx, continue_pipe_open_smb, c);
@@ -224,31 +225,25 @@ static void continue_smb2_connect(struct tevent_req *subreq)
struct pipe_np_smb2_state *s = talloc_get_type(c->private_data,
struct pipe_np_smb2_state);
struct smb2_tree *t;
- struct smbXcli_conn *conn;
- struct smbXcli_session *session;
- struct smbXcli_tcon *tcon;
/* receive result of smb2 connect request */
c->status = smb2_connect_recv(subreq, s->io.conn, &t);
TALLOC_FREE(subreq);
if (!composite_is_ok(c)) return;
- /* prepare named pipe open parameters */
- s->io.pipe_name = dcerpc_binding_get_string_option(s->io.binding, "endpoint");
- if (s->io.pipe_name == NULL) {
- composite_error(c, NT_STATUS_INVALID_PARAMETER_MIX);
- return;
- }
-
- conn = t->session->transport->conn;
- session = t->session->smbXcli;
- tcon = t->smbXcli;
+ s->io.smb.conn = t->session->transport->conn;
+ s->io.smb.session = t->session->smbXcli;
+ s->io.smb.tcon = t->smbXcli;
+ s->io.smb.pipe_name = dcerpc_binding_get_string_option(s->io.binding,
+ "endpoint");
/* send named pipe open request */
open_req = dcerpc_pipe_open_smb_send(s->io.conn,
- conn, session, tcon,
+ s->io.smb.conn,
+ s->io.smb.session,
+ s->io.smb.tcon,
DCERPC_REQUEST_TIMEOUT * 1000,
- s->io.pipe_name);
+ s->io.smb.pipe_name);
if (composite_nomem(open_req, c)) return;
composite_continue(c, open_req, continue_pipe_open_smb2, c);
@@ -624,7 +619,6 @@ static void continue_connect(struct composite_context *c, struct pipe_connect_st
ZERO_STRUCT(pc);
pc.conn = s->pipe->conn;
pc.binding = s->binding;
- pc.pipe_name = NULL;
pc.interface = s->table;
pc.creds = s->credentials;
pc.resolve_ctx = lpcfg_resolve_context(s->lp_ctx);