diff options
author | Yann Ylavic <ylavic@apache.org> | 2018-06-12 10:01:04 +0200 |
---|---|---|
committer | Yann Ylavic <ylavic@apache.org> | 2018-06-12 10:01:04 +0200 |
commit | 2cbd1d02221d12f7937e8825a669f0087cbbcc9f (patch) | |
tree | 5865b84b0c1e65786f9e37bdbfb44518dfdeb7a2 /server/core.c | |
parent | Make use of the new apr_crypto_rng API if available. (diff) | |
download | apache2-2cbd1d02221d12f7937e8825a669f0087cbbcc9f.tar.xz apache2-2cbd1d02221d12f7937e8825a669f0087cbbcc9f.zip |
Follow up to r1833368: apr_crypto_prng_after_fork() now used a PID.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1833383 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'server/core.c')
-rw-r--r-- | server/core.c | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/server/core.c b/server/core.c index 0ea953a3fa..a679f9d00d 100644 --- a/server/core.c +++ b/server/core.c @@ -5455,10 +5455,14 @@ static void core_child_init(apr_pool_t *pchild, server_rec *s) /* The MPMs use plain fork() and not apr_proc_fork(), so we have to * take care of the random generator manually in the child. */ + apr_proc_t proc; + + memset(&proc, 0, sizeof(proc)); + proc.pid = getpid(); + #if USE_APR_CRYPTO_PRNG - apr_crypto_prng_after_fork(); + apr_crypto_prng_after_fork(&proc); #else - apr_proc_t proc; #if APR_HAS_THREADS int threaded_mpm; if (ap_mpm_query(AP_MPMQ_IS_THREADED, &threaded_mpm) == APR_SUCCESS @@ -5466,9 +5470,8 @@ static void core_child_init(apr_pool_t *pchild, server_rec *s) { apr_thread_mutex_create(&rng_mutex, APR_THREAD_MUTEX_DEFAULT, pchild); } - proc.pid = getpid(); - apr_random_after_fork(&proc); #endif + apr_random_after_fork(&proc); #endif /* USE_APR_CRYPTO_PRNG */ } |