]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
smbd: call reinit_after_fork() in the needed places
authorStefan Metzmacher <metze@samba.org>
Mon, 14 Apr 2008 23:01:59 +0000 (01:01 +0200)
committerStefan Metzmacher <metze@samba.org>
Fri, 18 Apr 2008 12:43:08 +0000 (14:43 +0200)
metze

source/smbd/server.c

index 108a55033c0b3e13d0caa1b586c65e7bc9f6c46c..337026a8ca22307b71d52565ec807da7edc89a03 100644 (file)
@@ -741,17 +741,9 @@ static bool open_sockets_smbd(bool is_daemon, bool interactive, const char *smb_
                                                                sizeof(remaddr)),
                                                                false);
 
-                               /* Reset the state of the random
-                                * number generation system, so
-                                * children do not get the same random
-                                * numbers as each other */
-
-                               set_need_random_reseed();
-                               /* tdb needs special fork handling - remove
-                                * CLEAR_IF_FIRST flags */
-                               if (tdb_reopen_all(1) == -1) {
-                                       DEBUG(0,("tdb_reopen_all failed.\n"));
-                                       smb_panic("tdb_reopen_all failed");
+                               if (!reinit_after_fork(smbd_messaging_context())) {
+                                       DEBUG(0,("reinit_after_fork() failed\n"));
+                                       smb_panic("reinit_after_fork() failed");
                                }
 
                                return True;
@@ -1384,12 +1376,10 @@ extern void build_options(bool screen);
        /* Setup aio signal handler. */
        initialize_async_io_handler();
 
-       /*
-        * For clustering, we need to re-init our ctdbd connection after the
-        * fork
-        */
-       if (!NT_STATUS_IS_OK(messaging_reinit(smbd_messaging_context())))
+       if (!reinit_after_fork(smbd_messaging_context())) {
+               DEBUG(0,("reinit_after_fork() failed\n"));
                exit(1);
+       }
 
        /* register our message handlers */
        messaging_register(smbd_messaging_context(), NULL,