/* prepare smb connection parameters: we're connecting to IPC$ share on
remote rpc server */
- conn->in.dest_host = s->io.binding->host;
- conn->in.dest_ports = lpcfg_smb_ports(lp_ctx);
- if (s->io.binding->target_hostname == NULL)
- conn->in.called_name = "*SMBSERVER"; /* FIXME: This is invalid */
- else
- conn->in.called_name = s->io.binding->target_hostname;
+ conn->in.dest_host = dcerpc_binding_get_string_option(s->io.binding, "host");
+ conn->in.dest_ports = lpcfg_smb_ports(lp_ctx);
+ conn->in.called_name =
+ dcerpc_binding_get_string_option(s->io.binding, "target_hostname");
+ if (conn->in.called_name == NULL) {
+ conn->in.called_name = "*SMBSERVER";
+ }
conn->in.socket_options = lpcfg_socket_options(lp_ctx);
conn->in.service = "IPC$";
conn->in.service_type = NULL;
struct pipe_np_smb2_state *s;
struct tevent_req *subreq;
struct smbcli_options options;
+ const char *host;
uint32_t flags;
/* composite context allocation and setup */
s->io = *io;
+ host = dcerpc_binding_get_string_option(s->io.binding, "host");
flags = dcerpc_binding_get_flags(s->io.binding);
/*
/* send smb2 connect request */
subreq = smb2_connect_send(s, c->event_ctx,
- s->io.binding->host,
+ host,
lpcfg_parm_string_list(mem_ctx, lp_ctx, NULL, "smb2", "ports", NULL),
"IPC$",
s->io.resolve_ctx,
c->private_data = s;
/* store input parameters in state structure */
- s->io = *io;
+ s->io = *io;
s->localaddr = dcerpc_binding_get_string_option(io->binding,
"localaddress");
- if (io->binding->host != NULL) {
- s->host = talloc_strdup(s, io->binding->host);
- if (composite_nomem(s->host, c)) return c;
- }
- if (io->binding->target_hostname != NULL) {
- s->target_hostname = talloc_strdup(s, io->binding->target_hostname);
- if (composite_nomem(s->target_hostname, c)) return c;
- }
+ s->host = dcerpc_binding_get_string_option(io->binding, "host");
+ s->target_hostname = dcerpc_binding_get_string_option(io->binding,
+ "target_hostname");
endpoint = dcerpc_binding_get_string_option(io->binding, "endpoint");
/* port number is a binding endpoint here */
if (endpoint != NULL) {
struct composite_context *pipe_smb_req;
struct composite_context *pipe_tcp_req;
struct composite_context *pipe_ncalrpc_req;
+ const char *target_hostname;
const char *endpoint;
/* composite context allocation and setup */
if (DEBUGLEVEL >= 10)
s->pipe2->conn->packet_log_dir = s->pipe->conn->packet_log_dir;
+ target_hostname = dcerpc_binding_get_string_option(s->binding, "target_hostname");
endpoint = dcerpc_binding_get_string_option(s->binding, "endpoint");
if (endpoint == NULL) {
/*
pipe_tcp_req = dcerpc_pipe_open_tcp_send(s->pipe2->conn,
s->localaddress,
s->peer_addr->addr,
- s->binding->target_hostname,
+ target_hostname,
atoi(endpoint),
resolve_context_init(s));
composite_continue(c, pipe_tcp_req, continue_open_tcp, c);