From 3b52f1543c89d79840dffb49d3f0d1c72160a5fc Mon Sep 17 00:00:00 2001 From: Samuel Cabrero Date: Tue, 26 Feb 2019 16:56:42 +0100 Subject: [PATCH] s3:rpc_server: Reinitialize dcesrv_context in external lsasd daemon Signed-off-by: Samuel Cabrero Reviewed-by: Andrew Bartlett --- source3/rpc_server/lsasd.c | 12 +++++++++++- source3/rpc_server/lsasd.h | 5 ++++- source3/smbd/server.c | 2 +- 3 files changed, 16 insertions(+), 3 deletions(-) diff --git a/source3/rpc_server/lsasd.c b/source3/rpc_server/lsasd.c index 908d1bbb560..3264385e7c2 100644 --- a/source3/rpc_server/lsasd.c +++ b/source3/rpc_server/lsasd.c @@ -837,7 +837,8 @@ done: } void start_lsasd(struct tevent_context *ev_ctx, - struct messaging_context *msg_ctx) + struct messaging_context *msg_ctx, + struct dcesrv_context *dce_ctx) { NTSTATUS status; struct pf_listen_fd listen_fd[LSASD_MAX_SOCKETS]; @@ -936,6 +937,15 @@ void start_lsasd(struct tevent_context *ev_ctx, exit(1); } + DBG_INFO("Reinitializing DCE/RPC server context\n"); + + status = dcesrv_reinit_context(dce_ctx); + if (!NT_STATUS_IS_OK(status)) { + DBG_ERR("Failed to reinit DCE/RPC context: %s\n", + nt_errstr(status)); + exit(1); + } + ok = lsasd_create_sockets(ev_ctx, msg_ctx, listen_fd, &listen_fd_size); if (!ok) { exit(1); diff --git a/source3/rpc_server/lsasd.h b/source3/rpc_server/lsasd.h index 0d261dd2181..dfb5ffc5e9e 100644 --- a/source3/rpc_server/lsasd.h +++ b/source3/rpc_server/lsasd.h @@ -25,7 +25,10 @@ #include "replace.h" #include "messages.h" +struct dcesrv_context; + void start_lsasd(struct tevent_context *ev_ctx, - struct messaging_context *msg_ctx); + struct messaging_context *msg_ctx, + struct dcesrv_context *dce_ctx); #endif diff --git a/source3/smbd/server.c b/source3/smbd/server.c index f00bd56209d..1822f538f55 100644 --- a/source3/smbd/server.c +++ b/source3/smbd/server.c @@ -2110,7 +2110,7 @@ extern void build_options(bool screen); } if (rpc_lsasd_daemon() == RPC_DAEMON_FORK) { - start_lsasd(ev_ctx, msg_ctx); + start_lsasd(ev_ctx, msg_ctx, dce_ctx); } if (rpc_fss_daemon() == RPC_DAEMON_FORK) {