s3:smbd: use smbd_reinit_after_fork
authorRalph Boehme <slow@samba.org>
Wed, 22 Apr 2015 10:00:10 +0000 (12:00 +0200)
committerJeremy Allison <jra@samba.org>
Wed, 22 Apr 2015 21:00:20 +0000 (23:00 +0200)
Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
source3/printing/queue_process.c
source3/printing/spoolssd.c
source3/rpc_server/epmd.c
source3/rpc_server/fssd.c
source3/rpc_server/lsasd.c
source3/smbd/process.c
source3/smbd/scavenger.c
source3/smbd/server.c

index 88196b4216f11f8800efb1c3320487fed07f99a5..50622dcb752e0f4689b5213433a5ad4fc83e853f 100644 (file)
@@ -373,7 +373,7 @@ pid_t start_background_queue(struct tevent_context *ev,
                close(pause_pipe[0]);
                pause_pipe[0] = -1;
 
-               status = reinit_after_fork(msg_ctx, ev, true);
+               status = smbd_reinit_after_fork(msg_ctx, ev, true);
 
                if (!NT_STATUS_IS_OK(status)) {
                        DEBUG(0,("reinit_after_fork() failed\n"));
index 11bd82f862c6ab76b8c028795051fbf1c8781025..3007898e2b043a0b133dbd0ad41383a9e0c18273 100644 (file)
@@ -645,9 +645,7 @@ pid_t start_spoolssd(struct tevent_context *ev_ctx,
                return pid;
        }
 
-       status = reinit_after_fork(msg_ctx,
-                                  ev_ctx,
-                                  true);
+       status = smbd_reinit_after_fork(msg_ctx, ev_ctx, true);
        if (!NT_STATUS_IS_OK(status)) {
                DEBUG(0,("reinit_after_fork() failed\n"));
                smb_panic("reinit_after_fork() failed");
index 6b6119b5e35957731fbe3b979a9abf3f4caab4b6..dad67aea39dfaefdb3768a8fdbfc1256f9ccf7c8 100644 (file)
@@ -162,9 +162,7 @@ void start_epmd(struct tevent_context *ev_ctx,
                return;
        }
 
-       status = reinit_after_fork(msg_ctx,
-                                  ev_ctx,
-                                  true);
+       status = smbd_reinit_after_fork(msg_ctx, ev_ctx, true);
        if (!NT_STATUS_IS_OK(status)) {
                DEBUG(0,("reinit_after_fork() failed\n"));
                smb_panic("reinit_after_fork() failed");
index eb9b7e6aad144e5259fb8e71da7d4e25330267a2..fc1f630c6bb29dbfe38d370b118ed94aa71ff480 100644 (file)
@@ -171,9 +171,7 @@ void start_fssd(struct tevent_context *ev_ctx,
        }
 
        /* child */
-       status = reinit_after_fork(msg_ctx,
-                                  ev_ctx,
-                                  true);
+       status = smbd_reinit_after_fork(msg_ctx, ev_ctx, true);
        if (!NT_STATUS_IS_OK(status)) {
                DEBUG(0,("reinit_after_fork() failed\n"));
                smb_panic("reinit_after_fork() failed");
index 42d91fdef0efaa4a1cfea534bcdf1f045323a5bd..d287bff89ee1903a8804972b7dd89c3e59108e32 100644 (file)
@@ -861,9 +861,7 @@ void start_lsasd(struct tevent_context *ev_ctx,
                return;
        }
 
-       status = reinit_after_fork(msg_ctx,
-                                  ev_ctx,
-                                  true);
+       status = smbd_reinit_after_fork(msg_ctx, ev_ctx, true);
        if (!NT_STATUS_IS_OK(status)) {
                DEBUG(0,("reinit_after_fork() failed\n"));
                smb_panic("reinit_after_fork() failed");
index 38edb028636ae4763d5181f2fdc097433171df0a..aa7f419a1b2a9e475cdd986e81205da762724b79 100644 (file)
@@ -3306,9 +3306,7 @@ bool fork_echo_handler(struct smbXsrv_connection *xconn)
                close(listener_pipe[0]);
                set_blocking(listener_pipe[1], false);
 
-               status = reinit_after_fork(xconn->msg_ctx,
-                                          xconn->ev_ctx,
-                                          true);
+               status = smbd_reinit_after_fork(xconn->msg_ctx, xconn->ev_ctx, true);
                if (!NT_STATUS_IS_OK(status)) {
                        DEBUG(1, ("reinit_after_fork failed: %s\n",
                                  nt_errstr(status)));
index 013b4d2405d319d5aaa9938c362d380d3479a028..19f9b43cc6dab7d8f3250cac4e50cb6497c81f20 100644 (file)
@@ -244,11 +244,9 @@ static bool smbd_scavenger_start(struct smbd_scavenger_state *state)
 
                close(fds[0]);
 
-               am_parent = NULL;
-
                set_my_unique_id(unique_id);
 
-               status = reinit_after_fork(state->msg, state->ev, true);
+               status = smbd_reinit_after_fork(state->msg, state->ev, true);
                if (!NT_STATUS_IS_OK(status)) {
                        DEBUG(2, ("reinit_after_fork failed: %s\n",
                                  nt_errstr(status)));
index 030f760a3a90243db09314cde541962491d1ea2c..6921719fb25c5a8376f1287522d56bf61af6bca2 100644 (file)
@@ -590,9 +590,6 @@ static void smbd_accept_connection(struct tevent_context *ev,
        if (pid == 0) {
                NTSTATUS status = NT_STATUS_OK;
 
-               /* Child code ... */
-               am_parent = NULL;
-
                /*
                 * Can't use TALLOC_FREE here. Nulling out the argument to it
                 * would overwrite memory we've just freed.
@@ -606,9 +603,7 @@ static void smbd_accept_connection(struct tevent_context *ev,
                 * them, counting worker smbds. */
                CatchChild();
 
-               status = reinit_after_fork(msg_ctx,
-                                          ev,
-                                          true);
+               status = smbd_reinit_after_fork(msg_ctx, ev, true);
                if (!NT_STATUS_IS_OK(status)) {
                        if (NT_STATUS_EQUAL(status,
                                            NT_STATUS_TOO_MANY_OPENED_FILES)) {