1
0
mirror of https://github.com/samba-team/samba.git synced 2025-01-24 02:04:21 +03:00

s3:smbd: move exit_firsttime checking to the start of exit_server_common()

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

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Guenther Deschner <gd@samba.org>
This commit is contained in:
Stefan Metzmacher 2020-07-06 16:42:46 +02:00 committed by Günther Deschner
parent 8fbb7ad275
commit e5a8b16a11

View File

@ -83,6 +83,11 @@ static void exit_server_common(enum server_exit_reason how,
struct messaging_context *msg_ctx = global_messaging_context();
NTSTATUS disconnect_status;
if (!exit_firsttime) {
exit(0);
}
exit_firsttime = false;
switch (how) {
case SERVER_EXIT_NORMAL:
disconnect_status = NT_STATUS_LOCAL_DISCONNECT;
@ -98,9 +103,6 @@ static void exit_server_common(enum server_exit_reason how,
xconn = client->connections;
}
if (!exit_firsttime)
exit(0);
exit_firsttime = false;
change_to_root_user();