From fc57b88e6a93d59ad243364a513d33cecf66e4ab Mon Sep 17 00:00:00 2001 From: Ralph Boehme Date: Sat, 3 Dec 2022 17:04:33 +0100 Subject: [PATCH] smbd: remove process shortname arg from reinit_after_fork() All callers pass NULL anyway, so it isn't used anymore. Signed-off-by: Ralph Boehme Reviewed-by: Jeremy Allison --- source3/include/proto.h | 3 +-- source3/lib/background.c | 2 +- source3/lib/util.c | 7 +------ source3/nmbd/asyncdns.c | 2 +- source3/nmbd/nmbd.c | 2 +- source3/printing/print_cups.c | 2 +- source3/rpc_server/rpc_host.c | 2 +- source3/smbd/server.c | 4 ++-- source3/smbd/server_exit.c | 2 +- source3/torture/test_g_lock.c | 6 +++--- source3/winbindd/winbindd.c | 2 +- source3/winbindd/winbindd_dual.c | 2 +- 12 files changed, 15 insertions(+), 21 deletions(-) diff --git a/source3/include/proto.h b/source3/include/proto.h index 4f40470e20f..bbd45c536ff 100644 --- a/source3/include/proto.h +++ b/source3/include/proto.h @@ -301,8 +301,7 @@ NTSTATUS init_before_fork(void); int parent_watch_fd(void); NTSTATUS reinit_after_fork(struct messaging_context *msg_ctx, struct tevent_context *ev_ctx, - bool parent_longlived, - const char *comment); + bool parent_longlived); NTSTATUS smbd_reinit_after_fork(struct messaging_context *msg_ctx, struct tevent_context *ev_ctx, bool parent_longlived); diff --git a/source3/lib/background.c b/source3/lib/background.c index 74f7496d4f6..cf6cc3abaa0 100644 --- a/source3/lib/background.c +++ b/source3/lib/background.c @@ -176,7 +176,7 @@ static void background_job_waited(struct tevent_req *subreq) close(fds[0]); - status = reinit_after_fork(state->msg, state->ev, true, NULL); + status = reinit_after_fork(state->msg, state->ev, true); if (NT_STATUS_IS_OK(status)) { res = state->fn(state->private_data); } else { diff --git a/source3/lib/util.c b/source3/lib/util.c index 912ce1d3004..eef76662f45 100644 --- a/source3/lib/util.c +++ b/source3/lib/util.c @@ -429,8 +429,7 @@ static void reinit_after_fork_pipe_handler(struct tevent_context *ev, NTSTATUS reinit_after_fork(struct messaging_context *msg_ctx, struct tevent_context *ev_ctx, - bool parent_longlived, - const char *comment) + bool parent_longlived) { NTSTATUS status = NT_STATUS_OK; int ret; @@ -503,10 +502,6 @@ NTSTATUS reinit_after_fork(struct messaging_context *msg_ctx, } } - if (comment) { - prctl_set_comment("%s", comment); - } - done: return status; } diff --git a/source3/nmbd/asyncdns.c b/source3/nmbd/asyncdns.c index e52380b03f0..2d4a9cd8446 100644 --- a/source3/nmbd/asyncdns.c +++ b/source3/nmbd/asyncdns.c @@ -167,7 +167,7 @@ void start_async_dns(struct messaging_context *msg) CatchSignal(SIGHUP, SIG_IGN); CatchSignal(SIGTERM, sig_term); - status = reinit_after_fork(msg, nmbd_event_context(), true, NULL); + status = reinit_after_fork(msg, nmbd_event_context(), true); if (!NT_STATUS_IS_OK(status)) { DEBUG(0,("reinit_after_fork() failed\n")); diff --git a/source3/nmbd/nmbd.c b/source3/nmbd/nmbd.c index 7470897587e..e5794cc13bd 100644 --- a/source3/nmbd/nmbd.c +++ b/source3/nmbd/nmbd.c @@ -983,7 +983,7 @@ static bool open_sockets(bool isdaemon, int port) pidfile_create(lp_pid_directory(), "nmbd"); - status = reinit_after_fork(msg, nmbd_event_context(), false, NULL); + status = reinit_after_fork(msg, nmbd_event_context(), false); if (!NT_STATUS_IS_OK(status)) { exit_daemon("reinit_after_fork() failed", map_errno_from_nt_status(status)); diff --git a/source3/printing/print_cups.c b/source3/printing/print_cups.c index 0bbd7c8eff3..4d83d398675 100644 --- a/source3/printing/print_cups.c +++ b/source3/printing/print_cups.c @@ -495,7 +495,7 @@ static bool cups_pcap_load_async(struct tevent_context *ev, close_all_print_db(); - status = reinit_after_fork(msg_ctx, ev, true, NULL); + status = reinit_after_fork(msg_ctx, ev, true); if (!NT_STATUS_IS_OK(status)) { DEBUG(0,("cups_pcap_load_async: reinit_after_fork() failed\n")); smb_panic("cups_pcap_load_async: reinit_after_fork() failed"); diff --git a/source3/rpc_server/rpc_host.c b/source3/rpc_server/rpc_host.c index 7ca24240a92..f58c825e7cc 100644 --- a/source3/rpc_server/rpc_host.c +++ b/source3/rpc_server/rpc_host.c @@ -2949,7 +2949,7 @@ int main(int argc, const char *argv[]) cmdline_daemon_cfg->no_process_group, log_stdout); - status = reinit_after_fork(msg_ctx, ev_ctx, false, NULL); + status = reinit_after_fork(msg_ctx, ev_ctx, false); if (!NT_STATUS_IS_OK(status)) { exit_daemon("reinit_after_fork() failed", map_errno_from_nt_status(status)); diff --git a/source3/smbd/server.c b/source3/smbd/server.c index d442e783381..b1c9e219e16 100644 --- a/source3/smbd/server.c +++ b/source3/smbd/server.c @@ -988,7 +988,7 @@ static void smbd_accept_connection(struct tevent_context *ev, smb_set_close_on_exec(fd); if (s->parent->interactive) { - reinit_after_fork(msg_ctx, ev, true, NULL); + reinit_after_fork(msg_ctx, ev, true); smbd_process(ev, msg_ctx, fd, true); exit_server_cleanly("end of interactive mode"); return; @@ -1884,7 +1884,7 @@ extern void build_options(bool screen); if (cmdline_daemon_cfg->daemon) pidfile_create(lp_pid_directory(), "smbd"); - status = reinit_after_fork(msg_ctx, ev_ctx, false, NULL); + status = reinit_after_fork(msg_ctx, ev_ctx, false); if (!NT_STATUS_IS_OK(status)) { exit_daemon("reinit_after_fork() failed", map_errno_from_nt_status(status)); } diff --git a/source3/smbd/server_exit.c b/source3/smbd/server_exit.c index d216fd7e06d..5e0c386e090 100644 --- a/source3/smbd/server_exit.c +++ b/source3/smbd/server_exit.c @@ -256,7 +256,7 @@ NTSTATUS smbd_reinit_after_fork(struct messaging_context *msg_ctx, { NTSTATUS ret; am_parent = NULL; - ret = reinit_after_fork(msg_ctx, ev_ctx, parent_longlived, NULL); + ret = reinit_after_fork(msg_ctx, ev_ctx, parent_longlived); initialize_password_db(true, ev_ctx); return ret; } diff --git a/source3/torture/test_g_lock.c b/source3/torture/test_g_lock.c index ad3793633f3..fee91270323 100644 --- a/source3/torture/test_g_lock.c +++ b/source3/torture/test_g_lock.c @@ -776,7 +776,7 @@ bool run_g_lock5(int dummy) if (child == 0) { TALLOC_FREE(ctx); - status = reinit_after_fork(msg, ev, false, ""); + status = reinit_after_fork(msg, ev, false); close(ready_pipe[0]); close(exit_pipe[1]); @@ -943,7 +943,7 @@ bool run_g_lock6(int dummy) if (child == 0) { TALLOC_FREE(ctx); - status = reinit_after_fork(msg, ev, false, ""); + status = reinit_after_fork(msg, ev, false); if (!NT_STATUS_IS_OK(status)) { fprintf(stderr, "reinit_after_fork failed: %s\n", nt_errstr(status)); @@ -1106,7 +1106,7 @@ bool run_g_lock7(int dummy) close(down_pipe[1]); down_pipe[1] = -1; - status = reinit_after_fork(msg, ev, false, ""); + status = reinit_after_fork(msg, ev, false); if (!NT_STATUS_IS_OK(status)) { fprintf(stderr, "reinit_after_fork failed: %s\n", diff --git a/source3/winbindd/winbindd.c b/source3/winbindd/winbindd.c index e0c10501c6c..50dc6d6bd92 100644 --- a/source3/winbindd/winbindd.c +++ b/source3/winbindd/winbindd.c @@ -1629,7 +1629,7 @@ int main(int argc, const char **argv) status = reinit_after_fork(global_messaging_context(), global_event_context(), - false, NULL); + false); if (!NT_STATUS_IS_OK(status)) { exit_daemon("Winbindd reinit_after_fork() failed", map_errno_from_nt_status(status)); } diff --git a/source3/winbindd/winbindd_dual.c b/source3/winbindd/winbindd_dual.c index 14627920ab0..8cb59b2f752 100644 --- a/source3/winbindd/winbindd_dual.c +++ b/source3/winbindd/winbindd_dual.c @@ -1530,7 +1530,7 @@ NTSTATUS winbindd_reinit_after_fork(const struct winbindd_child *myself, status = reinit_after_fork( global_messaging_context(), global_event_context(), - true, NULL); + true); if (!NT_STATUS_IS_OK(status)) { DEBUG(0,("reinit_after_fork() failed\n")); return status; -- 2.11.4.GIT