]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
s3:lib: reset all tevent trace callbacks in reinit_after_fork()
authorPavel Filipenský <pfilipen@redhat.com>
Tue, 10 May 2022 11:06:53 +0000 (13:06 +0200)
committerJeremy Allison <jra@samba.org>
Tue, 10 May 2022 17:31:31 +0000 (17:31 +0000)
Signed-off-by: Pavel Filipenský <pfilipen@redhat.com>
With "tevent: add event trace api" we have now more callbacks to reset.
Reviewed-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
source3/lib/util.c

index b45c573db3d2cff869ff4d9fa45dea1c5db1b2d9..912ce1d3004c1e2f2bbfd06ffdd2badfedad6195 100644 (file)
@@ -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");
                }