From: Pavel Filipenský Date: Tue, 10 May 2022 11:06:53 +0000 (+0200) Subject: s3:lib: reset all tevent trace callbacks in reinit_after_fork() X-Git-Tag: talloc-2.3.4~209 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=463f694d5c68141b161128944e46161d63e4569a;p=thirdparty%2Fsamba.git s3:lib: reset all tevent trace callbacks in reinit_after_fork() Signed-off-by: Pavel Filipenský With "tevent: add event trace api" we have now more callbacks to reset. Reviewed-by: Andreas Schneider Reviewed-by: Jeremy Allison --- diff --git a/source3/lib/util.c b/source3/lib/util.c index b45c573db3d..912ce1d3004 100644 --- a/source3/lib/util.c +++ b/source3/lib/util.c @@ -455,7 +455,16 @@ NTSTATUS reinit_after_fork(struct messaging_context *msg_ctx, } if (ev_ctx != NULL) { + /* + * The parent can have different private data for the callbacks, + * which are gone in the child. Reset the callbacks to be safe. + */ tevent_set_trace_callback(ev_ctx, NULL, NULL); + tevent_set_trace_fd_callback(ev_ctx, NULL, NULL); + tevent_set_trace_signal_callback(ev_ctx, NULL, NULL); + tevent_set_trace_timer_callback(ev_ctx, NULL, NULL); + tevent_set_trace_immediate_callback(ev_ctx, NULL, NULL); + tevent_set_trace_queue_callback(ev_ctx, NULL, NULL); if (tevent_re_initialise(ev_ctx) != 0) { smb_panic(__location__ ": Failed to re-initialise event context"); }