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-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=fe8683e534ede141f93985756b285217ca95292a;p=thirdparty%2Fapache%2Fhttpd.git 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/modules/ssl@93441 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/ssl_engine_init.c b/ssl_engine_init.c index b587235a063..c7a97764548 100644 --- a/ssl_engine_init.c +++ b/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/ssl_engine_mutex.c b/ssl_engine_mutex.c index 8164d28b696..fb0f06b4132 100644 --- a/ssl_engine_mutex.c +++ b/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; }