summaryrefslogtreecommitdiffstats
path: root/source
diff options
context:
space:
mode:
authorStefan Metzmacher <metze@samba.org>2008-04-15 01:01:59 +0200
committerKarolin Seeger <kseeger@samba.org>2008-04-21 08:40:39 +0200
commit9547b4f8cf7dbe5b46a97572cbfd59d02d6f0777 (patch)
treeb7586fb437c62e68f1143ee95b25421a283943f6 /source
parentf6ae698ce291dcb58923634ff7b10300e80c065e (diff)
downloadsamba-9547b4f8cf7dbe5b46a97572cbfd59d02d6f0777.tar.gz
samba-9547b4f8cf7dbe5b46a97572cbfd59d02d6f0777.tar.xz
samba-9547b4f8cf7dbe5b46a97572cbfd59d02d6f0777.zip
smbd: call reinit_after_fork() in the needed places
metze (cherry picked from commit 425b3513a45cf98b53235470a3536be86d56d1c2)
Diffstat (limited to 'source')
-rw-r--r--source/smbd/server.c22
1 files changed, 6 insertions, 16 deletions
diff --git a/source/smbd/server.c b/source/smbd/server.c
index f5b9267a154..97a124e65a6 100644
--- a/source/smbd/server.c
+++ b/source/smbd/server.c
@@ -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,