You are viewing a plain text version of this content. The canonical link for it is here.
Posted to cvs@httpd.apache.org by je...@apache.org on 2002/02/16 19:35:21 UTC

cvs commit: httpd-2.0/modules/ssl ssl_engine_init.c ssl_engine_mutex.c

jerenkrantz    02/02/16 10:35:21

  Modified:    .        CHANGES
               modules/ssl ssl_engine_init.c ssl_engine_mutex.c
  Log:
  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 <my...@vishnu.vidya.com>
  Reviewed by:	Justin Erenkrantz
  
  Revision  Changes    Path
  1.589     +4 -0      httpd-2.0/CHANGES
  
  Index: CHANGES
  ===================================================================
  RCS file: /home/cvs/httpd-2.0/CHANGES,v
  retrieving revision 1.588
  retrieving revision 1.589
  diff -u -r1.588 -r1.589
  --- CHANGES	15 Feb 2002 22:26:34 -0000	1.588
  +++ CHANGES	16 Feb 2002 18:35:21 -0000	1.589
  @@ -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 <my...@vishnu.vidya.com>]
  +
     *) Add reference counting to mod_mem_cache cache objects to
        better manage removing objects from the cache.
        [Bill Stoddard]
  
  
  
  1.25      +3 -1      httpd-2.0/modules/ssl/ssl_engine_init.c
  
  Index: ssl_engine_init.c
  ===================================================================
  RCS file: /home/cvs/httpd-2.0/modules/ssl/ssl_engine_init.c,v
  retrieving revision 1.24
  retrieving revision 1.25
  diff -u -r1.24 -r1.25
  --- ssl_engine_init.c	11 Jan 2002 06:05:18 -0000	1.24
  +++ ssl_engine_init.c	16 Feb 2002 18:35:21 -0000	1.25
  @@ -214,7 +214,9 @@
       /*
        *  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);
   
       /*
  
  
  
  1.10      +5 -1      httpd-2.0/modules/ssl/ssl_engine_mutex.c
  
  Index: ssl_engine_mutex.c
  ===================================================================
  RCS file: /home/cvs/httpd-2.0/modules/ssl/ssl_engine_mutex.c,v
  retrieving revision 1.9
  retrieving revision 1.10
  diff -u -r1.9 -r1.10
  --- ssl_engine_mutex.c	11 Jan 2002 06:05:18 -0000	1.9
  +++ ssl_engine_mutex.c	16 Feb 2002 18:35:21 -0000	1.10
  @@ -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;
   }