httpd-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From traw...@apache.org
Subject cvs commit: httpd-2.0/modules/ssl ssl_scache_dbm.c
Date Tue, 01 Oct 2002 17:54:15 GMT
trawick     2002/10/01 10:54:15

  Modified:    .        CHANGES
               modules/ssl ssl_scache_dbm.c
  Log:
  Fix a mutex problem in mod_ssl session cache support which
  could lead to an infinite loop.
  
  PR:                     12705
  Diagnosis submitted by: amund.elstad@ergo.no (Amund Elstad)
  Coded by:               Jeff Trawick
  
  Revision  Changes    Path
  1.943     +4 -0      httpd-2.0/CHANGES
  
  Index: CHANGES
  ===================================================================
  RCS file: /home/cvs/httpd-2.0/CHANGES,v
  retrieving revision 1.942
  retrieving revision 1.943
  diff -u -r1.942 -r1.943
  --- CHANGES	30 Sep 2002 05:10:06 -0000	1.942
  +++ CHANGES	1 Oct 2002 17:54:14 -0000	1.943
  @@ -1,5 +1,9 @@
   Changes with Apache 2.0.43
   
  +  *) Fix a mutex problem in mod_ssl session cache support which
  +     could lead to an infinite loop.  PR 12705  
  +     [amund.elstad@ergo.no (Amund Elstad), Jeff Trawick]
  +
     *) Allow POST requests and CGI scripts to work when DAV is enabled
        on the location.  [Ryan Bloom]
   
  
  
  
  1.17      +6 -0      httpd-2.0/modules/ssl/ssl_scache_dbm.c
  
  Index: ssl_scache_dbm.c
  ===================================================================
  RCS file: /home/cvs/httpd-2.0/modules/ssl/ssl_scache_dbm.c,v
  retrieving revision 1.16
  retrieving revision 1.17
  diff -u -r1.16 -r1.17
  --- ssl_scache_dbm.c	17 May 2002 11:24:17 -0000	1.16
  +++ ssl_scache_dbm.c	1 Oct 2002 17:54:15 -0000	1.17
  @@ -228,21 +228,25 @@
        * XXX: Should we open the dbm against r->pool so the cleanup will
        * do the apr_dbm_close? This would make the code a bit cleaner.
        */
  +    ssl_mutex_on(s);
       if ((rc = apr_dbm_open(&dbm, mc->szSessionCacheDataFile,
   	    APR_DBM_RWCREATE, SSL_DBM_FILE_MODE, mc->pPool)) != APR_SUCCESS) {
           ap_log_error(APLOG_MARK, APLOG_ERR, rc, s,
                        "Cannot open SSLSessionCache DBM file `%s' for reading "
                        "(fetch)",
                        mc->szSessionCacheDataFile);
  +        ssl_mutex_off(s);
           return NULL;
       }
       rc = apr_dbm_fetch(dbm, dbmkey, &dbmval);
       if (rc != APR_SUCCESS) {
           apr_dbm_close(dbm);
  +        ssl_mutex_off(s);
           return NULL;
       }
       if (dbmval.dptr == NULL || dbmval.dsize <= sizeof(time_t)) {
           apr_dbm_close(dbm);
  +        ssl_mutex_off(s);
           return NULL;
       }
   
  @@ -251,12 +255,14 @@
       ucpData = (UCHAR *)malloc(nData);
       if (ucpData == NULL) {
           apr_dbm_close(dbm);
  +        ssl_mutex_off(s);
           return NULL;
       }
       memcpy(ucpData, (char *)dbmval.dptr+sizeof(time_t), nData);
       memcpy(&expiry, dbmval.dptr, sizeof(time_t));
   
       apr_dbm_close(dbm);
  +    ssl_mutex_off(s);
   
       /* make sure the stuff is still not expired */
       now = time(NULL);
  
  
  

Mime
View raw message