1
0
mirror of https://github.com/samba-team/samba.git synced 2024-12-23 17:34:34 +03:00

s3:rpc_server: Reinitialize dcesrv_context in external epmd daemon

Signed-off-by: Samuel Cabrero <scabrero@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
This commit is contained in:
Samuel Cabrero 2019-02-26 14:18:34 +01:00 committed by Samuel Cabrero
parent 1f87794d12
commit f1eec15c37
3 changed files with 19 additions and 8 deletions

View File

@ -137,7 +137,8 @@ static bool epmapper_shutdown_cb(void *ptr) {
}
void start_epmd(struct tevent_context *ev_ctx,
struct messaging_context *msg_ctx)
struct messaging_context *msg_ctx,
struct dcesrv_context *dce_ctx)
{
struct rpc_srv_callbacks epmapper_cb;
NTSTATUS status;
@ -196,6 +197,15 @@ void start_epmd(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);
}
status = rpc_epmapper_init(&epmapper_cb);
if (!NT_STATUS_IS_OK(status)) {
DEBUG(0, ("Failed to register epmd rpc interface! (%s)\n",

View File

@ -25,7 +25,10 @@
#include "replace.h"
#include "messages.h"
struct dcesrv_context;
void start_epmd(struct tevent_context *ev_ctx,
struct messaging_context *msg_ctx);
struct messaging_context *msg_ctx,
struct dcesrv_context *dce_ctx);
#endif

View File

@ -2090,12 +2090,6 @@ extern void build_options(bool screen);
return -1;
}
if (is_daemon && !interactive) {
if (rpc_epmapper_daemon() == RPC_DAEMON_FORK) {
start_epmd(ev_ctx, msg_ctx);
}
}
status = dcesrv_init(ev_ctx, ev_ctx, msg_ctx, dce_ctx);
if (!NT_STATUS_IS_OK(status)) {
DBG_ERR("Failed to setup RPC server: %s\n", nt_errstr(status));
@ -2111,6 +2105,10 @@ extern void build_options(bool screen);
* and we fork a copy of ourselves here */
if (is_daemon && !interactive) {
if (rpc_epmapper_daemon() == RPC_DAEMON_FORK) {
start_epmd(ev_ctx, msg_ctx, dce_ctx);
}
if (rpc_lsasd_daemon() == RPC_DAEMON_FORK) {
start_lsasd(ev_ctx, msg_ctx);
}