if (endpoints_match(ep->ep_description, binding)) {
struct dcesrv_if_list *ifl;
for (ifl=ep->interface_list; ifl; ifl=ifl->next) {
- if (interface_match(&(ifl->iface), iface)) {
- return &(ifl->iface);
+ if (interface_match(ifl->iface, iface)) {
+ return ifl->iface;
}
}
}
{
struct dcesrv_if_list *ifl;
for (ifl=endpoint->interface_list; ifl; ifl=ifl->next) {
- if (interface_match_by_uuid(&(ifl->iface), uuid, if_version)) {
- return &(ifl->iface);
+ if (interface_match_by_uuid(ifl->iface, uuid, if_version)) {
+ return ifl->iface;
}
}
return NULL;
return NT_STATUS_NO_MEMORY;
}
- ifl->iface = dcesrv_get_mgmt_interface();
+ ifl->iface = talloc_memdup(ifl,
+ dcesrv_get_mgmt_interface(),
+ sizeof(struct dcesrv_interface));
+ if (ifl->iface == NULL) {
+ talloc_free(ep);
+ return NT_STATUS_NO_MEMORY;
+ }
DLIST_ADD(ep->interface_list, ifl);
}
}
/* copy the given interface struct to the one on the endpoints interface list */
- memcpy(&(ifl->iface),iface, sizeof(struct dcesrv_interface));
+ ifl->iface = talloc_memdup(ifl,
+ iface,
+ sizeof(struct dcesrv_interface));
+ if (ifl->iface == NULL) {
+ talloc_free(ep);
+ return NT_STATUS_NO_MEMORY;
+ }
/* if we have a security descriptor given,
* we should see if we can set it up on the endpoint
/* the list of interfaces available on this endpoint */
struct dcesrv_if_list {
struct dcesrv_if_list *next, *prev;
- struct dcesrv_interface iface;
+ struct dcesrv_interface *iface;
} *interface_list;
/*
for (l = ep->interface_list; l; l = l->next) {
vector->count++;
vector->if_id = talloc_realloc(mem_ctx, vector->if_id, struct ndr_syntax_id_p, vector->count);
- vector->if_id[vector->count-1].id = &l->iface.syntax_id;
+ vector->if_id[vector->count-1].id = &l->iface->syntax_id;
}
return WERR_OK;
}
/* include the generated boilerplate */
#include "librpc/gen_ndr/ndr_mgmt_s.c"
-const struct dcesrv_interface dcesrv_get_mgmt_interface(void)
+const struct dcesrv_interface *dcesrv_get_mgmt_interface(void)
{
- return dcesrv_mgmt_interface;
+ return &dcesrv_mgmt_interface;
}
DEBUG(0,("service_setup_stream_socket(address=%s,port=%u) for ",
address, port));
for (iface = e->interface_list; iface; iface = iface->next) {
- DEBUGADD(0, ("%s ", iface->iface.name));
+ DEBUGADD(0, ("%s ", iface->iface->name));
}
DEBUGADD(0, ("failed - %s\n",
nt_errstr(status)));
DEBUG(4,("Successfully listening on ncacn_ip_tcp endpoint [%s]:[%s] for ",
address, port_str));
for (iface = e->interface_list; iface; iface = iface->next) {
- DEBUGADD(4, ("%s ", iface->iface.name));
+ DEBUGADD(4, ("%s ", iface->iface->name));
}
DEBUGADD(4, ("\n"));
}
if (!*eps) {
return 0;
}
- (*eps)[total].name = iface->iface.name;
+ (*eps)[total].name = iface->iface->name;
description = dcerpc_binding_dup(*eps, d->ep_description);
if (description == NULL) {
}
status = dcerpc_binding_set_abstract_syntax(description,
- &iface->iface.syntax_id);
+ &iface->iface->syntax_id);
if (!NT_STATUS_IS_OK(status)) {
return 0;
}
status = dcerpc_binding_build_tower(*eps, description, &(*eps)[total].ep);
TALLOC_FREE(description);
if (!NT_STATUS_IS_OK(status)) {
- DEBUG(1, ("Unable to build tower for %s - %s\n",
- iface->iface.name, nt_errstr(status)));
+ DBG_ERR("Unable to build tower for %s - %s\n",
+ iface->iface->name,
+ nt_errstr(status));
continue;
}
total++;