summaryrefslogtreecommitdiff
path: root/source3/rpc_server
diff options
context:
space:
mode:
authorAndreas Schneider <asn@samba.org>2011-06-16 16:22:49 +0200
committerAndrew Bartlett <abartlet@samba.org>2011-07-04 18:28:14 +1000
commit726b6c6e528112dca3caa1316ad0acf716736aa2 (patch)
tree3b167115608130b866c6c0bbe5df16da3c50eb87 /source3/rpc_server
parent784035fd5301bbe5c611e0ed3c21d4e795da9d17 (diff)
downloadsamba-726b6c6e528112dca3caa1316ad0acf716736aa2.tar.gz
samba-726b6c6e528112dca3caa1316ad0acf716736aa2.tar.bz2
samba-726b6c6e528112dca3caa1316ad0acf716736aa2.zip
s3-epmapper: Replace server_id in the epmapper.
Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Diffstat (limited to 'source3/rpc_server')
-rw-r--r--source3/rpc_server/epmapper/srv_epmapper.c21
1 files changed, 17 insertions, 4 deletions
diff --git a/source3/rpc_server/epmapper/srv_epmapper.c b/source3/rpc_server/epmapper/srv_epmapper.c
index 70f665dadf..49f2c9ad0e 100644
--- a/source3/rpc_server/epmapper/srv_epmapper.c
+++ b/source3/rpc_server/epmapper/srv_epmapper.c
@@ -22,6 +22,7 @@
#include "includes.h"
#include "ntdomain.h"
#include "../libcli/security/security.h"
+#include "../lib/tsocket/tsocket.h"
#include "librpc/gen_ndr/srv_epmapper.h"
#include "srv_epmapper.h"
#include "auth.h"
@@ -528,6 +529,7 @@ error_status_t _epm_Lookup(struct pipes_struct *p,
if (r->in.entry_handle == NULL ||
policy_handle_empty(r->in.entry_handle)) {
struct GUID *obj;
+ char *srv_addr = NULL;
DEBUG(7, ("_epm_Lookup: No entry_handle found, creating it.\n"));
@@ -543,6 +545,11 @@ error_status_t _epm_Lookup(struct pipes_struct *p,
obj = r->in.object;
}
+ if (p->local_address != NULL) {
+ srv_addr = tsocket_address_inet_addr_string(p->local_address,
+ tmp_ctx);
+ }
+
switch (r->in.inquiry_type) {
case RPC_C_EP_ALL_ELTS:
/*
@@ -553,7 +560,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,
+ srv_addr,
&eps->e);
break;
case RPC_C_EP_MATCH_BY_IF:
@@ -576,7 +583,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,
+ srv_addr,
&eps->e);
break;
case RPC_C_EP_MATCH_BY_OBJ:
@@ -587,7 +594,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,
+ srv_addr,
&eps->e);
break;
default:
@@ -909,6 +916,7 @@ error_status_t _epm_Map(struct pipes_struct *p,
if (r->in.entry_handle == NULL ||
policy_handle_empty(r->in.entry_handle)) {
struct GUID *obj;
+ char *srv_addr = NULL;
DEBUG(7, ("_epm_Map: No entry_handle found, creating it.\n"));
@@ -936,10 +944,15 @@ error_status_t _epm_Map(struct pipes_struct *p,
obj = r->in.object;
}
+ if (p->local_address != NULL) {
+ srv_addr = tsocket_address_inet_addr_string(p->local_address,
+ tmp_ctx);
+ }
+
eps->count = build_ep_list(eps,
endpoint_table,
obj,
- p->server_id == NULL ? NULL : p->server_id->addr,
+ srv_addr,
&eps->e);
if (eps->count == 0) {
rc = EPMAPPER_STATUS_NO_MORE_ENTRIES;