summaryrefslogtreecommitdiff
path: root/source4/rpc_server/dcerpc_sock.c
diff options
context:
space:
mode:
authorJelmer Vernooij <jelmer@samba.org>2004-10-24 22:46:47 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 13:02:28 -0500
commit06b3879c8fec97ef5de9b969301611e28fff00de (patch)
tree0bdf15f1211d86b78b601edeea609e1904eb858f /source4/rpc_server/dcerpc_sock.c
parent36db6faff3d495f5906d8e34275493234c2399f8 (diff)
downloadsamba-06b3879c8fec97ef5de9b969301611e28fff00de.tar.gz
samba-06b3879c8fec97ef5de9b969301611e28fff00de.tar.bz2
samba-06b3879c8fec97ef5de9b969301611e28fff00de.zip
r3167: Add a member 'endpoint' to the dcerpc_binding struct to use instead of
options[0]. (This used to be commit 18582083af800abd3d8de40eb73255c8ae6598dd)
Diffstat (limited to 'source4/rpc_server/dcerpc_sock.c')
-rw-r--r--source4/rpc_server/dcerpc_sock.c31
1 files changed, 10 insertions, 21 deletions
diff --git a/source4/rpc_server/dcerpc_sock.c b/source4/rpc_server/dcerpc_sock.c
index d5646a7c7a..8ba7464a79 100644
--- a/source4/rpc_server/dcerpc_sock.c
+++ b/source4/rpc_server/dcerpc_sock.c
@@ -60,9 +60,9 @@ static void add_socket_rpc_unix(struct server_service *service,
struct dcesrv_socket_context *dcesrv_sock;
uint16_t port = 1;
- sock = service_setup_socket(service,model_ops, "unix", e->ep_description.options[0], &port);
+ sock = service_setup_socket(service,model_ops, "unix", e->ep_description.endpoint, &port);
if (!sock) {
- DEBUG(0,("service_setup_socket(path=%s) failed\n",e->ep_description.options[0]));
+ DEBUG(0,("service_setup_socket(path=%s) failed\n",e->ep_description.endpoint));
return;
}
@@ -89,22 +89,16 @@ static void add_socket_rpc_ncalrpc(struct server_service *service,
uint16_t port = 1;
char *full_path;
- if (!e->ep_description.options) {
- e->ep_description.options = talloc_array_p(dce_ctx, const char *, 2);
- e->ep_description.options[0] = NULL;
- }
-
- if (!e->ep_description.options[0]) {
+ if (!e->ep_description.endpoint) {
/* No identifier specified: generate one */
- e->ep_description.options[0] = generate_random_str(dce_ctx, 10);
- e->ep_description.options[1] = NULL;
+ e->ep_description.endpoint = generate_random_str(dce_ctx, 10);
}
- full_path = talloc_asprintf(dce_ctx, "%s/%s", lp_ncalrpc_dir(), e->ep_description.options[0]);
+ full_path = talloc_asprintf(dce_ctx, "%s/%s", lp_ncalrpc_dir(), e->ep_description.endpoint);
sock = service_setup_socket(service,model_ops, "unix", full_path, &port);
if (!sock) {
- DEBUG(0,("service_setup_socket(identifier=%s,path=%s) failed\n",e->ep_description.options[0], full_path));
+ DEBUG(0,("service_setup_socket(identifier=%s,path=%s) failed\n",e->ep_description.endpoint, full_path));
return;
}
@@ -137,8 +131,8 @@ static void add_socket_rpc_tcp_iface(struct server_service *service,
uint16_t port = 0;
const char *ip_str = talloc_strdup(service, inet_ntoa(*ifip));
- if (e->ep_description.options && e->ep_description.options[0])
- port = atoi(e->ep_description.options[0]);
+ if (e->ep_description.endpoint)
+ port = atoi(e->ep_description.endpoint);
sock = service_setup_socket(service,model_ops, "ipv4", ip_str, &port);
if (!sock) {
@@ -146,13 +140,8 @@ static void add_socket_rpc_tcp_iface(struct server_service *service,
return;
}
- /* And put the settings back into the binding. This will
- * go away once we store the 'encoded' endpoint instead of a
- * string describing it */
- if (e->ep_description.options == NULL) {
- e->ep_description.options = talloc_array_p(dce_ctx, const char *, 2);
- e->ep_description.options[0] = talloc_asprintf(dce_ctx, "%d", port);
- e->ep_description.options[1] = NULL;
+ if (e->ep_description.endpoint == NULL) {
+ e->ep_description.endpoint = talloc_asprintf(dce_ctx, "%d", port);
}
dcesrv_sock = talloc_p(sock, struct dcesrv_socket_context);