You are viewing a plain text version of this content. The canonical link for it is here.
Posted to cvs@httpd.apache.org by yl...@apache.org on 2018/06/12 08:01:04 UTC
svn commit: r1833383 - /httpd/httpd/trunk/server/core.c
Author: ylavic
Date: Tue Jun 12 08:01:04 2018
New Revision: 1833383
URL: http://svn.apache.org/viewvc?rev=1833383&view=rev
Log:
Follow up to r1833368: apr_crypto_prng_after_fork() now used a PID.
Modified:
httpd/httpd/trunk/server/core.c
Modified: httpd/httpd/trunk/server/core.c
URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/server/core.c?rev=1833383&r1=1833382&r2=1833383&view=diff
==============================================================================
--- httpd/httpd/trunk/server/core.c (original)
+++ httpd/httpd/trunk/server/core.c Tue Jun 12 08:01:04 2018
@@ -5455,10 +5455,14 @@ static void core_child_init(apr_pool_t *
/* 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 *
{
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 */
}