diff options
Diffstat (limited to 'source4/librpc')
-rw-r--r-- | source4/librpc/config.mk | 2 | ||||
-rw-r--r-- | source4/librpc/rpc/dcerpc_secondary.c | 13 | ||||
-rw-r--r-- | source4/librpc/rpc/dcerpc_sock.c | 13 |
3 files changed, 15 insertions, 13 deletions
diff --git a/source4/librpc/config.mk b/source4/librpc/config.mk index dcf2f3e0ab..7871a93604 100644 --- a/source4/librpc/config.mk +++ b/source4/librpc/config.mk @@ -57,7 +57,7 @@ NDR_SECURITY_OBJ_FILES = ../librpc/gen_ndr/ndr_security.o \ $(gen_ndrsrcdir)/ndr_server_id.o PUBLIC_HEADERS += ../librpc/gen_ndr/security.h - +PUBLIC_HEADERS += $(gen_ndrsrcdir)/server_id.h [SUBSYSTEM::NDR_AUDIOSRV] PUBLIC_DEPENDENCIES = LIBNDR diff --git a/source4/librpc/rpc/dcerpc_secondary.c b/source4/librpc/rpc/dcerpc_secondary.c index 8ac235c67c..1d76c65f40 100644 --- a/source4/librpc/rpc/dcerpc_secondary.c +++ b/source4/librpc/rpc/dcerpc_secondary.c @@ -31,13 +31,14 @@ #include "auth/credentials/credentials.h" #include "param/param.h" #include "libcli/resolve/resolve.h" - +#include "lib/socket/socket.h" struct sec_conn_state { struct dcerpc_pipe *pipe; struct dcerpc_pipe *pipe2; struct dcerpc_binding *binding; struct smbcli_tree *tree; + struct socket_address *peer_addr; }; @@ -94,11 +95,17 @@ _PUBLIC_ struct composite_context* dcerpc_secondary_connection_send(struct dcerp return c; case NCACN_IP_TCP: + s->peer_addr = dcerpc_socket_peer_addr(s->pipe->conn, s); + if (!s->peer_addr) { + composite_error(c, NT_STATUS_INVALID_PARAMETER); + return c; + } + pipe_tcp_req = dcerpc_pipe_open_tcp_send(s->pipe2->conn, - s->binding->host, + s->peer_addr->addr, s->binding->target_hostname, atoi(s->binding->endpoint), - dcerpc_resolve_ctx(s->pipe->conn)); + resolve_context_init(s)); composite_continue(c, pipe_tcp_req, continue_open_tcp, c); return c; diff --git a/source4/librpc/rpc/dcerpc_sock.c b/source4/librpc/rpc/dcerpc_sock.c index 548f270cc0..3cc8421339 100644 --- a/source4/librpc/rpc/dcerpc_sock.c +++ b/source4/librpc/rpc/dcerpc_sock.c @@ -39,7 +39,6 @@ struct sock_private { struct packet_context *packet; uint32_t pending_reads; - struct resolve_context *resolve_ctx; const char *path; /* For ncacn_unix_sock and ncalrpc */ }; @@ -306,7 +305,6 @@ static void continue_socket_connect(struct composite_context *ctx) static struct composite_context *dcerpc_pipe_open_socket_send(TALLOC_CTX *mem_ctx, struct dcerpc_connection *cn, - struct resolve_context *resolve_context, struct socket_address *server, const char *target_hostname, const char *full_path, @@ -337,11 +335,9 @@ static struct composite_context *dcerpc_pipe_open_socket_send(TALLOC_CTX *mem_ct talloc_steal(s->sock, s->socket_ctx); - s->sock->resolve_ctx = resolve_context; s->sock->path = talloc_reference(s->sock, full_path); conn_req = socket_connect_send(s->socket_ctx, NULL, s->server, 0, - resolve_context, c->event_ctx); composite_continue(c, conn_req, continue_socket_connect, c); return c; @@ -390,7 +386,6 @@ static void continue_ip_resolve_name(struct composite_context *ctx) /* resolve_nbt_name gives only ipv4 ... - send socket open request */ sock_ipv4_req = dcerpc_pipe_open_socket_send(c, s->conn, - s->resolve_ctx, s->srvaddr, s->target_hostname, NULL, NCACN_IP_TCP); @@ -566,7 +561,6 @@ struct composite_context *dcerpc_pipe_open_unix_stream_send(struct dcerpc_connec /* send socket open request */ sock_unix_req = dcerpc_pipe_open_socket_send(c, s->conn, - NULL, s->srvaddr, NULL, s->path, NCALRPC); @@ -637,7 +631,7 @@ struct composite_context* dcerpc_pipe_open_pipe_send(struct dcerpc_connection *c if (composite_nomem(s->srvaddr, c)) return c; /* send socket open request */ - sock_np_req = dcerpc_pipe_open_socket_send(c, s->conn, NULL, s->srvaddr, NULL, s->path, NCALRPC); + sock_np_req = dcerpc_pipe_open_socket_send(c, s->conn, s->srvaddr, NULL, s->path, NCALRPC); composite_continue(c, sock_np_req, continue_np_open_socket, c); return c; } @@ -670,8 +664,9 @@ const char *dcerpc_unix_socket_path(struct dcerpc_connection *p) return sock->path; } -struct resolve_context *dcerpc_resolve_ctx(struct dcerpc_connection *p) +struct socket_address *dcerpc_socket_peer_addr(struct dcerpc_connection *p, TALLOC_CTX *mem_ctx) { struct sock_private *sock = (struct sock_private *)p->transport.private_data; - return sock->resolve_ctx; + return socket_get_peer_addr(sock->sock, mem_ctx); } + |