if (!composite_is_ok(c)) return;
/* prepare named pipe open parameters */
- s->io.pipe_name = s->io.binding->endpoint;
+ 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;
if (!composite_is_ok(c)) return;
/* prepare named pipe open parameters */
- s->io.pipe_name = s->io.binding->endpoint;
+ 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;
struct composite_context *c;
struct pipe_ip_tcp_state *s;
struct composite_context *pipe_req;
+ const char *endpoint;
/* composite context allocation and setup */
c = composite_create(mem_ctx, io->pipe->conn->event_ctx);
s->target_hostname = talloc_strdup(s, io->binding->target_hostname);
if (composite_nomem(s->target_hostname, c)) return c;
}
- /* port number is a binding endpoint here */
- s->port = atoi(io->binding->endpoint);
+ endpoint = dcerpc_binding_get_string_option(io->binding, "endpoint");
+ /* port number is a binding endpoint here */
+ if (endpoint != NULL) {
+ s->port = atoi(endpoint);
+ }
+
+ if (s->port == 0) {
+ composite_error(c, NT_STATUS_INVALID_PARAMETER_MIX);
+ return c;
+ }
/* send pipe open request on tcp/ip */
pipe_req = dcerpc_pipe_open_tcp_send(s->io.pipe->conn, s->localaddr, s->host, s->target_hostname,
/* prepare pipe open parameters and store them in state structure
also, verify whether biding endpoint is not null */
s->io = *io;
-
- if (!io->binding->endpoint) {
- DEBUG(0, ("Path to unix socket not specified\n"));
- composite_error(c, NT_STATUS_INVALID_PARAMETER);
+
+ s->path = dcerpc_binding_get_string_option(io->binding, "endpoint");
+ if (s->path == NULL) {
+ composite_error(c, NT_STATUS_INVALID_PARAMETER_MIX);
return c;
}
- s->path = talloc_strdup(c, io->binding->endpoint); /* path is a binding endpoint here */
- if (composite_nomem(s->path, c)) return c;
-
/* send pipe open request on unix socket */
pipe_req = dcerpc_pipe_open_unix_stream_send(s->io.pipe->conn, s->path);
composite_continue(c, pipe_req, continue_pipe_open_ncacn_unix_stream, c);
struct composite_context *c;
struct pipe_ncalrpc_state *s;
struct composite_context *pipe_req;
+ const char *endpoint;
/* composite context allocation and setup */
c = composite_create(mem_ctx, io->pipe->conn->event_ctx);
/* store input parameters in state structure */
s->io = *io;
+ endpoint = dcerpc_binding_get_string_option(io->binding, "endpoint");
+ if (endpoint == NULL) {
+ composite_error(c, NT_STATUS_INVALID_PARAMETER_MIX);
+ return c;
+ }
+
/* send pipe open request */
- pipe_req = dcerpc_pipe_open_pipe_send(s->io.pipe->conn, lpcfg_ncalrpc_dir(lp_ctx),
- s->io.binding->endpoint);
+ pipe_req = dcerpc_pipe_open_pipe_send(s->io.pipe->conn,
+ lpcfg_ncalrpc_dir(lp_ctx),
+ endpoint);
composite_continue(c, pipe_req, continue_pipe_open_ncalrpc, c);
return c;
}
struct composite_context);
struct pipe_connect_state *s = talloc_get_type(c->private_data,
struct pipe_connect_state);
-
+ const char *endpoint;
+
c->status = dcerpc_epm_map_binding_recv(ctx);
if (!composite_is_ok(c)) return;
- DEBUG(4,("Mapped to DCERPC endpoint %s\n", s->binding->endpoint));
-
+ endpoint = dcerpc_binding_get_string_option(s->binding, "endpoint");
+ DEBUG(4,("Mapped to DCERPC endpoint %s\n", endpoint));
+
continue_connect(c, s);
}
struct composite_context *pipe_smb_req;
struct composite_context *pipe_tcp_req;
struct composite_context *pipe_ncalrpc_req;
-
+ const char *endpoint;
+
/* composite context allocation and setup */
c = composite_create(p, p->conn->event_ctx);
if (c == NULL) return NULL;
if (DEBUGLEVEL >= 10)
s->pipe2->conn->packet_log_dir = s->pipe->conn->packet_log_dir;
+ endpoint = dcerpc_binding_get_string_option(s->binding, "endpoint");
+ if (endpoint == NULL) {
+ /*
+ * We may fallback to the endpoint of the given connection
+ */
+ endpoint = dcerpc_binding_get_string_option(s->pipe->binding, "endpoint");
+ }
+ if (endpoint == NULL) {
+ composite_error(c, NT_STATUS_INVALID_PARAMETER_MIX);
+ return c;
+ }
+
/* open second dcerpc pipe using the same transport as for primary pipe */
switch (s->pipe->conn->transport.transport) {
case NCACN_NP:
- pipe_smb_req = dcerpc_secondary_smb_send(s->pipe->conn, s->pipe2->conn,
- s->binding->endpoint);
+ pipe_smb_req = dcerpc_secondary_smb_send(s->pipe->conn,
+ s->pipe2->conn,
+ endpoint);
composite_continue(c, pipe_smb_req, continue_open_smb, c);
return c;
s->localaddress,
s->peer_addr->addr,
s->binding->target_hostname,
- atoi(s->binding->endpoint),
+ atoi(endpoint),
resolve_context_init(s));
composite_continue(c, pipe_tcp_req, continue_open_tcp, c);
return c;