smbd: remove process shortname arg from reinit_after_fork()
authorRalph Boehme <slow@samba.org>
Sat, 3 Dec 2022 16:04:33 +0000 (17:04 +0100)
committerJeremy Allison <jra@samba.org>
Wed, 14 Dec 2022 01:38:29 +0000 (01:38 +0000)
All callers pass NULL anyway, so it isn't used anymore.

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
12 files changed:
source3/include/proto.h
source3/lib/background.c
source3/lib/util.c
source3/nmbd/asyncdns.c
source3/nmbd/nmbd.c
source3/printing/print_cups.c
source3/rpc_server/rpc_host.c
source3/smbd/server.c
source3/smbd/server_exit.c
source3/torture/test_g_lock.c
source3/winbindd/winbindd.c
source3/winbindd/winbindd_dual.c

index 4f40470e20f5093f26e80ce0f4671520a82a758e..bbd45c536ff11ba3a4368c046a75f307454327f1 100644 (file)
@@ -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);
index 74f7496d4f60594b533fc2ebad86ed9193ea8bf0..cf6cc3abaa0c6f8feb83bdcadbb3f7dc88c520d8 100644 (file)
@@ -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 {
index 912ce1d3004c1e2f2bbfd06ffdd2badfedad6195..eef76662f452c956119c5611c56429df66bee279 100644 (file)
@@ -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;
 }
index e52380b03f0d3a3dcf38aaf365c86ba1392ed3ee..2d4a9cd8446c570f697119194bb2c0263e6be6d4 100644 (file)
@@ -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"));
index 7470897587ea4e3fbaf92dd2f4fae20da956c42c..e5794cc13bda15924ba5b2670061e5d5a451f91c 100644 (file)
@@ -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));
index 0bbd7c8eff38d3a44bb6b15bde5a56bf7f5ada23..4d83d398675320fa7be5839360ec68aaa8e68794 100644 (file)
@@ -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");
index 7ca24240a929fc461b458bd441686c0afe72a9ee..f58c825e7cc76aac815dce19696b5361709b8033 100644 (file)
@@ -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));
index d442e7833810bae479203d2c5e26af894d3d4e2c..b1c9e219e1692498de2263fd293df775b7072675 100644 (file)
@@ -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));
        }
index d216fd7e06dce0f367d6cbbc8182901a12af0e08..5e0c386e090b79e03af3dad145d4304898065c8c 100644 (file)
@@ -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;
 }
index ad3793633f3ec804342c31e609c98e52829ed681..fee91270323b870744958ff9296cf9b470c06f03 100644 (file)
@@ -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",
index e0c10501c6cc9844552596c0e69d9803d0839a9c..50dc6d6bd9237d6c4d5a762596282f29f1ea5356 100644 (file)
@@ -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));
        }
index 14627920ab0141d07cd4b3a28bbe616c1e05e615..8cb59b2f7522b76765c1bfa243a3c32e3958faf1 100644 (file)
@@ -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;