Return-Path: Delivered-To: apmail-httpd-dev-archive@httpd.apache.org Received: (qmail 91765 invoked by uid 500); 16 Feb 2002 00:22:27 -0000 Mailing-List: contact dev-help@httpd.apache.org; run by ezmlm Precedence: bulk Reply-To: dev@httpd.apache.org list-help: list-unsubscribe: list-post: Delivered-To: mailing list dev@httpd.apache.org Received: (qmail 91752 invoked from network); 16 Feb 2002 00:22:26 -0000 Date: Fri, 15 Feb 2002 17:21:29 -0800 From: Adam Sussman To: dev@httpd.apache.org Subject: [PATCH] mod_ssl segfault on child init Message-ID: <20020215172129.H7538@vishnu.vidya.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5i X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N 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. -adam Index: ssl_engine_init.c =================================================================== RCS file: /home/cvspublic/httpd-2.0/modules/ssl/ssl_engine_init.c,v retrieving revision 1.24 diff -u -r1.24 ssl_engine_init.c --- ssl_engine_init.c 11 Jan 2002 06:05:18 -0000 1.24 +++ ssl_engine_init.c 16 Feb 2002 00:16:30 -0000 @@ -214,7 +214,7 @@ /* * 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); /* Index: ssl_engine_mutex.c =================================================================== RCS file: /home/cvspublic/httpd-2.0/modules/ssl/ssl_engine_mutex.c,v retrieving revision 1.9 diff -u -r1.9 ssl_engine_mutex.c --- ssl_engine_mutex.c 11 Jan 2002 06:05:18 -0000 1.9 +++ ssl_engine_mutex.c 16 Feb 2002 00:16:30 -0000 @@ -70,8 +70,12 @@ 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; }