diff options
-rw-r--r-- | source3/librpc/rpc/dcerpc_ep.c | 13 | ||||
-rw-r--r-- | source3/librpc/rpc/dcerpc_ep.h | 1 | ||||
-rw-r--r-- | source3/rpc_server/rpc_ep_setup.c | 2 |
3 files changed, 15 insertions, 1 deletions
diff --git a/source3/librpc/rpc/dcerpc_ep.c b/source3/librpc/rpc/dcerpc_ep.c index 54db4cdbca..bda24a6865 100644 --- a/source3/librpc/rpc/dcerpc_ep.c +++ b/source3/librpc/rpc/dcerpc_ep.c @@ -27,6 +27,7 @@ NTSTATUS dcerpc_binding_vector_create(TALLOC_CTX *mem_ctx, const struct ndr_interface_table *iface, + uint16_t port, struct dcerpc_binding_vector **pbvec) { struct dcerpc_binding_vector *bvec; @@ -81,7 +82,17 @@ NTSTATUS dcerpc_binding_vector_create(TALLOC_CTX *mem_ctx, } break; case NCACN_IP_TCP: - /* TODO */ + if (port == 0) { + continue; + } + + b->endpoint = talloc_asprintf(b, "%u", port); + if (b->endpoint == NULL) { + status = NT_STATUS_NO_MEMORY; + goto done; + } + + break; case NCALRPC: /* TODO */ default: diff --git a/source3/librpc/rpc/dcerpc_ep.h b/source3/librpc/rpc/dcerpc_ep.h index 6da7f9b9b2..f88f468611 100644 --- a/source3/librpc/rpc/dcerpc_ep.h +++ b/source3/librpc/rpc/dcerpc_ep.h @@ -27,6 +27,7 @@ struct dcerpc_binding_vector { NTSTATUS dcerpc_binding_vector_create(TALLOC_CTX *mem_ctx, const struct ndr_interface_table *iface, + uint16_t port, struct dcerpc_binding_vector **pbvec); /** diff --git a/source3/rpc_server/rpc_ep_setup.c b/source3/rpc_server/rpc_ep_setup.c index e8640fa1e9..fbb1ba5459 100644 --- a/source3/rpc_server/rpc_ep_setup.c +++ b/source3/rpc_server/rpc_ep_setup.c @@ -134,6 +134,7 @@ static NTSTATUS _rpc_ep_register(struct tevent_context *ev_ctx, status = dcerpc_binding_vector_create(talloc_tos(), iface, + port, &v); if (!NT_STATUS_IS_OK(status)) { return status; @@ -166,6 +167,7 @@ static NTSTATUS _rpc_ep_unregister(const struct ndr_interface_table *iface) status = dcerpc_binding_vector_create(talloc_tos(), iface, + 0, &v); if (!NT_STATUS_IS_OK(status)) { return status; |