From: Justin Erenkrantz Date: Sat, 16 Feb 2002 18:35:21 +0000 (+0000) Subject: If the file specified by SSLMutex cannot be created (because the directory does... X-Git-Tag: 2.0.33~235 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=39b3c29d1ee7ce61def7bb05fe0794bacb81b404;p=apache If the file specified by SSLMutex cannot be created (because the directory does not exist for example), children will segfault on init without giving any reason that the user can figure out. This happens because the module init in the parent never checks to see if the mutex intialization succeded. This patch adds this check and a user-friendly error message. (Justin made one formatting change to this patch.) Submitted by: Adam Sussman Reviewed by: Justin Erenkrantz git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@93441 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/CHANGES b/CHANGES index 9a56dafe92..7d65b43929 100644 --- a/CHANGES +++ b/CHANGES @@ -1,4 +1,8 @@ Changes with Apache 2.0.33-dev + + *) Fix segfault and display error when SSLMutex file can not be + created. [Adam Sussman ] + *) Add reference counting to mod_mem_cache cache objects to better manage removing objects from the cache. [Bill Stoddard] diff --git a/modules/ssl/ssl_engine_init.c b/modules/ssl/ssl_engine_init.c index b587235a06..c7a9776454 100644 --- a/modules/ssl/ssl_engine_init.c +++ b/modules/ssl/ssl_engine_init.c @@ -214,7 +214,9 @@ int ssl_init_Module(apr_pool_t *p, apr_pool_t *plog, /* * initialize the mutex handling and session caching */ - ssl_mutex_init(s, p); + if (!ssl_mutex_init(s, p)) { + return HTTP_INTERNAL_SERVER_ERROR; + } ssl_scache_init(s, p); /* diff --git a/modules/ssl/ssl_engine_mutex.c b/modules/ssl/ssl_engine_mutex.c index 8164d28b69..fb0f06b413 100644 --- a/modules/ssl/ssl_engine_mutex.c +++ b/modules/ssl/ssl_engine_mutex.c @@ -70,8 +70,12 @@ int ssl_mutex_init(server_rec *s, apr_pool_t *p) return TRUE; if (apr_lock_create(&mc->pMutex, APR_MUTEX, APR_LOCKALL, APR_LOCK_DEFAULT, - mc->szMutexFile, p) != APR_SUCCESS) + mc->szMutexFile, p) != APR_SUCCESS) { + ssl_log(s, SSL_LOG_CRIT|SSL_ADD_ERRNO, + "Cannot create SSLMutex file `%s'", + mc->szMutexFile); return FALSE; + } return TRUE; }