From 8efdac83ff764de66f3fba63faf6c8fddc409c03 Mon Sep 17 00:00:00 2001 From: Andreas Schneider Date: Thu, 18 Aug 2011 19:05:27 +0200 Subject: s3-lsasd: Add missing ncalrpc listeners. Signed-off-by: Andreas Schneider Signed-off-by: Simo Sorce --- source3/rpc_server/lsasd.c | 66 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 66 insertions(+) (limited to 'source3/rpc_server') diff --git a/source3/rpc_server/lsasd.c b/source3/rpc_server/lsasd.c index 9855641036..5eb0fe5617 100644 --- a/source3/rpc_server/lsasd.c +++ b/source3/rpc_server/lsasd.c @@ -644,6 +644,22 @@ static bool lsasd_create_sockets(struct tevent_context *ev_ctx, goto done; } + fd = create_dcerpc_ncalrpc_socket("lsarpc"); + if (fd < 0) { + ok = false; + goto done; + } + listen_fd[*listen_fd_size] = fd; + (*listen_fd_size)++; + + rc = listen(fd, pf_lsasd_cfg.max_allowed_clients); + if (rc == -1) { + DEBUG(0, ("Failed to listen on lsarpc ncalrpc - %s\n", + strerror(errno))); + ok = false; + goto done; + } + v = dcerpc_binding_vector_dup(tmp_ctx, v_orig); if (v == NULL) { ok = false; @@ -661,6 +677,12 @@ static bool lsasd_create_sockets(struct tevent_context *ev_ctx, goto done; } + status = dcerpc_binding_vector_add_unix(&ndr_table_lsarpc, v, "lsarpc"); + if (!NT_STATUS_IS_OK(status)) { + ok = false; + goto done; + } + status = rpc_ep_register(ev_ctx, msg_ctx, &ndr_table_lsarpc, v); if (!NT_STATUS_IS_OK(status)) { ok = false; @@ -684,6 +706,22 @@ static bool lsasd_create_sockets(struct tevent_context *ev_ctx, listen_fd[*listen_fd_size] = fd; (*listen_fd_size)++; + fd = create_dcerpc_ncalrpc_socket("samr"); + if (fd < 0) { + ok = false; + goto done; + } + listen_fd[*listen_fd_size] = fd; + (*listen_fd_size)++; + + rc = listen(fd, pf_lsasd_cfg.max_allowed_clients); + if (rc == -1) { + DEBUG(0, ("Failed to listen on samr ncalrpc - %s\n", + strerror(errno))); + ok = false; + goto done; + } + v = dcerpc_binding_vector_dup(tmp_ctx, v_orig); if (v == NULL) { ok = false; @@ -701,6 +739,12 @@ static bool lsasd_create_sockets(struct tevent_context *ev_ctx, goto done; } + status = dcerpc_binding_vector_add_unix(&ndr_table_lsarpc, v, "samr"); + if (!NT_STATUS_IS_OK(status)) { + ok = false; + goto done; + } + status = rpc_ep_register(ev_ctx, msg_ctx, &ndr_table_samr, v); if (!NT_STATUS_IS_OK(status)) { ok = false; @@ -724,6 +768,22 @@ static bool lsasd_create_sockets(struct tevent_context *ev_ctx, listen_fd[*listen_fd_size] = fd; (*listen_fd_size)++; + fd = create_dcerpc_ncalrpc_socket("netlogon"); + if (fd < 0) { + ok = false; + goto done; + } + listen_fd[*listen_fd_size] = fd; + (*listen_fd_size)++; + + rc = listen(fd, pf_lsasd_cfg.max_allowed_clients); + if (rc == -1) { + DEBUG(0, ("Failed to listen on netlogon ncalrpc - %s\n", + strerror(errno))); + ok = false; + goto done; + } + v = dcerpc_binding_vector_dup(tmp_ctx, v_orig); if (v == NULL) { ok = false; @@ -741,6 +801,12 @@ static bool lsasd_create_sockets(struct tevent_context *ev_ctx, goto done; } + status = dcerpc_binding_vector_add_unix(&ndr_table_lsarpc, v, "netlogon"); + if (!NT_STATUS_IS_OK(status)) { + ok = false; + goto done; + } + status = rpc_ep_register(ev_ctx, msg_ctx, &ndr_table_netlogon, v); if (!NT_STATUS_IS_OK(status)) { ok = false; -- cgit