]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
smbd: call exit_server_cleanly() to avoid panicking
authorRalph Boehme <slow@samba.org>
Wed, 5 Jul 2023 09:33:58 +0000 (11:33 +0200)
committerStefan Metzmacher <metze@samba.org>
Wed, 5 Jul 2023 13:14:08 +0000 (13:14 +0000)
The parent smdb forwards SIGTERM to its process group in order to kill all
children like the scavenger. This happens from a function registered via
atexit() which means the signal forwarding is happening very briefly before the
main smbd process exits. When exiting the pipe between smbd and scavenger is
closed which triggers a file event in the scavenger.

However, due to kernel sheduling it is possible that the file descriptor event
is received before the signal, where we call exit_server() which call
smb_panic() at the end.

Change the exit to exit_server_cleanly() and just log this event at level 2
which we already do.

BUG: https://bugzilla.samba.org/show_bug.cgi?id=15275

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
Autobuild-User(master): Stefan Metzmacher <metze@samba.org>
Autobuild-Date(master): Wed Jul  5 13:14:08 UTC 2023 on atb-devel-224

source3/smbd/scavenger.c

index 897ddf1617c8b2c4834ae95ad50884354c214cd7..ce2a58a4ae4811d7b0bd3d3bad7399187dfa871e 100644 (file)
@@ -104,7 +104,7 @@ static void smbd_scavenger_parent_dead(struct tevent_context *event_ctx,
                  server_id_str_buf(*state->scavenger_id, &tmp1),
                  server_id_str_buf(state->parent_id, &tmp2)));
 
-       exit_server("smbd_scavenger_parent_dead");
+       exit_server_cleanly("smbd_scavenger_parent_dead");
 }
 
 static void scavenger_sig_term_handler(struct tevent_context *ev,