From aa777df5571e874cb39ccdb20d6adb25fc8f5e13 Mon Sep 17 00:00:00 2001 From: Andreas Schneider Date: Tue, 22 Feb 2011 16:48:43 +0100 Subject: s3-epmap: Return the correct ip address. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Günther Deschner --- source3/rpc_server/epmapper/srv_epmapper.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/source3/rpc_server/epmapper/srv_epmapper.c b/source3/rpc_server/epmapper/srv_epmapper.c index c364890afa..1852b5bf97 100644 --- a/source3/rpc_server/epmapper/srv_epmapper.c +++ b/source3/rpc_server/epmapper/srv_epmapper.c @@ -154,6 +154,7 @@ static struct dcesrv_endpoint *find_endpoint(struct dcesrv_endpoint *endpoint_li static uint32_t build_ep_list(TALLOC_CTX *mem_ctx, struct dcesrv_endpoint *endpoint_list, const struct GUID *uuid, + const char *srv_addr, struct dcesrv_ep_iface **peps) { struct dcesrv_ep_iface *eps = NULL; @@ -185,6 +186,11 @@ static uint32_t build_ep_list(TALLOC_CTX *mem_ctx, description = d->ep_description; description->object = iface->iface->syntax_id; + if (description->transport == NCACN_IP_TCP && + srv_addr != NULL && + strequal(description->host, "0.0.0.0")) { + description->host = srv_addr; + } status = dcerpc_binding_build_tower(eps, description, @@ -467,6 +473,7 @@ error_status_t _epm_Lookup(struct pipes_struct *p, eps->count = build_ep_list(eps, endpoint_table, NULL, + p->server_id == NULL ? NULL : p->server_id->addr, &eps->e); break; case RPC_C_EP_MATCH_BY_IF: @@ -489,6 +496,7 @@ error_status_t _epm_Lookup(struct pipes_struct *p, eps->count = build_ep_list(eps, endpoint_table, &r->in.interface_id->uuid, + p->server_id == NULL ? NULL : p->server_id->addr, &eps->e); break; case RPC_C_EP_MATCH_BY_OBJ: @@ -499,6 +507,7 @@ error_status_t _epm_Lookup(struct pipes_struct *p, eps->count = build_ep_list(eps, endpoint_table, r->in.object, + p->server_id == NULL ? NULL : p->server_id->addr, &eps->e); break; default: @@ -850,6 +859,7 @@ error_status_t _epm_Map(struct pipes_struct *p, eps->count = build_ep_list(eps, endpoint_table, obj, + p->server_id == NULL ? NULL : p->server_id->addr, &eps->e); if (eps->count == 0) { rc = EPMAPPER_STATUS_NO_MORE_ENTRIES; -- cgit