diff options
Diffstat (limited to 'source4/librpc')
-rw-r--r-- | source4/librpc/config.mk | 16 | ||||
-rw-r--r-- | source4/librpc/rpc/dcerpc_secondary.c | 13 | ||||
-rw-r--r-- | source4/librpc/rpc/dcerpc_sock.c | 13 |
3 files changed, 22 insertions, 20 deletions
diff --git a/source4/librpc/config.mk b/source4/librpc/config.mk index 475d14ec4d..7871a93604 100644 --- a/source4/librpc/config.mk +++ b/source4/librpc/config.mk @@ -56,8 +56,8 @@ NDR_SECURITY_OBJ_FILES = ../librpc/gen_ndr/ndr_security.o \ ../librpc/ndr/ndr_sec_helper.o \ $(gen_ndrsrcdir)/ndr_server_id.o -PUBLIC_HEADERS += ../librpc/gen_ndr/security.h) - +PUBLIC_HEADERS += ../librpc/gen_ndr/security.h +PUBLIC_HEADERS += $(gen_ndrsrcdir)/server_id.h [SUBSYSTEM::NDR_AUDIOSRV] PUBLIC_DEPENDENCIES = LIBNDR @@ -166,7 +166,7 @@ PUBLIC_DEPENDENCIES = LIBNDR NDR_LSA NDR_SECURITY NDR_SAMR_OBJ_FILES = ../librpc/gen_ndr/ndr_samr.o -PUBLIC_HEADERS += $(addprefix $(librpcsrcdir)/, gen_ndr/samr.h gen_ndr/ndr_samr.h gen_ndr/ndr_samr_c.h) +PUBLIC_HEADERS += $(addprefix ../librpc/gen_ndr/, samr.h ndr_samr.h ndr_samr_c.h) [SUBSYSTEM::NDR_NFS4ACL] PUBLIC_DEPENDENCIES = LIBNDR NDR_SECURITY @@ -199,14 +199,14 @@ PUBLIC_DEPENDENCIES = LIBNDR NDR_SVCCTL_OBJ_FILES = ../librpc/gen_ndr/ndr_svcctl.o -PUBLIC_HEADERS += $(addprefix $(librpcsrcdir)/, gen_ndr/ndr_svcctl.h gen_ndr/svcctl.h) +PUBLIC_HEADERS += $(addprefix ../librpc/gen_ndr/, ndr_svcctl.h svcctl.h) [SUBSYSTEM::NDR_ATSVC] PUBLIC_DEPENDENCIES = LIBNDR NDR_ATSVC_OBJ_FILES = ../librpc/gen_ndr/ndr_atsvc.o -PUBLIC_HEADERS += $(addprefix ../librpc/gen_ndr, atsvc.h ndr_atsvc.h) +PUBLIC_HEADERS += $(addprefix ../librpc/gen_ndr/, atsvc.h ndr_atsvc.h) [SUBSYSTEM::NDR_EVENTLOG] PUBLIC_DEPENDENCIES = LIBNDR NDR_LSA @@ -626,9 +626,9 @@ dcerpc_OBJ_FILES = $(addprefix $(dcerpcsrcdir)/, dcerpc.o dcerpc_auth.o dcerpc_s $(eval $(call proto_header_template,$(dcerpcsrcdir)/dcerpc_proto.h,$(dcerpc_OBJ_FILES:.o=.c))) -PUBLIC_HEADERS += $(addprefix $(librpcsrcdir)/, rpc/dcerpc.h \ - gen_ndr/mgmt.h gen_ndr/ndr_mgmt.h gen_ndr/ndr_mgmt_c.h \ - gen_ndr/epmapper.h gen_ndr/ndr_epmapper.h gen_ndr/ndr_epmapper_c.h) +PUBLIC_HEADERS += $(addprefix $(librpcsrcdir)/, rpc/dcerpc.h) \ + $(addprefix ../librpc/gen_ndr/, mgmt.h ndr_mgmt.h ndr_mgmt_c.h \ + epmapper.h ndr_epmapper.h ndr_epmapper_c.h) [PYTHON::python_dcerpc] 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); } + |