summaryrefslogtreecommitdiff
path: root/source3
diff options
context:
space:
mode:
authorJeremy Allison <jra@samba.org>2001-06-06 22:04:26 +0000
committerJeremy Allison <jra@samba.org>2001-06-06 22:04:26 +0000
commite8e07a26eb1365d195c0345ad075ff828517fe53 (patch)
tree7677da882c8f9cbea4385be2135624413f3c6ad9 /source3
parent3e808f0af4ed19dfa431b6cbe3baf778e0de44cb (diff)
downloadsamba-e8e07a26eb1365d195c0345ad075ff828517fe53.tar.gz
samba-e8e07a26eb1365d195c0345ad075ff828517fe53.tar.bz2
samba-e8e07a26eb1365d195c0345ad075ff828517fe53.zip
Changes to use new genrand code that got missed while I was in Japan.
Jeremy. (This used to be commit 5a15831b9ae79ce1ce34d5574fe5da114d184e45)
Diffstat (limited to 'source3')
-rw-r--r--source3/lib/util_sock.c21
-rw-r--r--source3/passdb/secrets.c29
2 files changed, 29 insertions, 21 deletions
diff --git a/source3/lib/util_sock.c b/source3/lib/util_sock.c
index b59debe929..144498138a 100644
--- a/source3/lib/util_sock.c
+++ b/source3/lib/util_sock.c
@@ -942,27 +942,6 @@ connect_again:
return res;
}
-
-/*******************************************************************
- Reset the 'done' variables so after a client process is created
- from a fork call these calls will be re-done. This should be
- expanded if more variables need reseting.
- ******************************************************************/
-
-
-void reset_globals_after_fork(void)
-{
- /*
- * Re-seed the random crypto generator, so all smbd's
- * started from the same parent won't generate the same
- * sequence.
- */
- {
- unsigned char dummy;
- generate_random_buffer( &dummy, 1, True);
- }
-}
-
/* the following 3 client_*() functions are nasty ways of allowing
some generic functions to get info that really should be hidden in
particular modules */
diff --git a/source3/passdb/secrets.c b/source3/passdb/secrets.c
index 7c65da0264..4a8a363923 100644
--- a/source3/passdb/secrets.c
+++ b/source3/passdb/secrets.c
@@ -176,3 +176,32 @@ BOOL trust_password_delete(char *domain)
{
return secrets_delete(trust_keystr(domain));
}
+
+/*******************************************************************
+ Reset the 'done' variables so after a client process is created
+ from a fork call these calls will be re-done. This should be
+ expanded if more variables need reseting.
+ ******************************************************************/
+
+void reset_globals_after_fork(void)
+{
+ unsigned char dummy;
+
+ /*
+ * Increment the global seed value to ensure every smbd starts
+ * with a new random seed.
+ */
+
+ if (tdb) {
+ uint32 initial_val = sys_getpid();
+ tdb_change_int_atomic(tdb, "INFO/random_seed", &initial_val, 1);
+ set_rand_reseed_data((unsigned char *)&initial_val, sizeof(initial_val));
+ }
+
+ /*
+ * Re-seed the random crypto generator, so all smbd's
+ * started from the same parent won't generate the same
+ * sequence.
+ */
+ generate_random_buffer( &dummy, 1, True);
+}