#include "librpc/gen_ndr/ndr_epmapper.h"
#include "librpc/gen_ndr/srv_epmapper.h"
#include "srv_epmapper.h"
+#include "auth.h"
+#include "ntdomain.h"
typedef uint32_t error_status_t;
iface->iface->name);
eps[total].syntax_id = iface->iface->syntax_id;
- description = d->ep_description;
+ description = dcerpc_binding_dup(mem_ctx, d->ep_description);
+ if (description == NULL) {
+ return 0;
+ }
description->object = iface->iface->syntax_id;
if (description->transport == NCACN_IP_TCP &&
srv_addr != NULL &&
status = dcerpc_binding_build_tower(eps,
description,
&eps[total].ep);
+ TALLOC_FREE(description);
if (NT_STATUS_IS_ERR(status)) {
DEBUG(1, ("Unable to build tower for %s\n",
iface->iface->name));
error_status_t rc;
NTSTATUS status;
uint32_t i;
+ struct dcerpc_binding *b;
+ struct dcesrv_endpoint *ep;
+ struct dcesrv_iface_list *iflist;
+ struct dcesrv_iface *iface;
+ bool add_ep;
/* If this is not a priviledged users, return */
if (p->transport != NCALRPC ||
r->in.num_ents));
for (i = 0; i < r->in.num_ents; i++) {
- struct dcerpc_binding *b = NULL;
- struct dcesrv_endpoint *ep;
- struct dcesrv_iface_list *iflist;
- struct dcesrv_iface *iface;
- bool add_ep = false;
+ add_ep = false;
+ b = NULL;
status = dcerpc_binding_from_tower(tmp_ctx,
&r->in.entries[i].tower->tower,
&b);
- if (!NT_STATUS_IS_OK(status)) {
+ if (NT_STATUS_EQUAL(status, NT_STATUS_NO_MEMORY)) {
rc = EPMAPPER_STATUS_NO_MEMORY;
goto done;
}
+ if (!NT_STATUS_IS_OK(status)) {
+ rc = EPMAPPER_STATUS_CANT_PERFORM_OP;
+ goto done;
+ }
DEBUG(3, ("_epm_Insert: Adding transport %s for %s\n",
derpc_transport_string_by_transport(b->transport),
/* No entry found, create it */
ep = talloc_zero(NULL, struct dcesrv_endpoint);
if (ep == NULL) {
- rc = EPMAPPER_STATUS_CANT_PERFORM_OP;
+ rc = EPMAPPER_STATUS_NO_MEMORY;
goto done;
}
add_ep = true;
if (r->in.num_ents > 0) {
struct dcesrv_ep_entry_list *el;
- el = talloc_zero(p->mem_ctx, struct dcesrv_ep_entry_list);
+ el = talloc_zero(p, struct dcesrv_ep_entry_list);
if (el == NULL) {
rc = EPMAPPER_STATUS_NO_MEMORY;
goto done;
error_status_t rc;
NTSTATUS status;
uint32_t i;
+ struct dcerpc_binding *b;
+ struct dcesrv_endpoint *ep;
+ struct dcesrv_iface iface;
+ struct dcesrv_iface_list *iflist;
DEBUG(3, ("_epm_Delete: Trying to delete %u entries.\n",
r->in.num_ents));
}
for (i = 0; i < r->in.num_ents; i++) {
- struct dcerpc_binding *b = NULL;
- struct dcesrv_endpoint *ep;
- struct dcesrv_iface iface;
- struct dcesrv_iface_list *iflist;
+ b = NULL;
status = dcerpc_binding_from_tower(tmp_ctx,
&r->in.entries[i].tower->tower,