httpd-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jor...@apache.org
Subject cvs commit: httpd-2.0/modules/ssl ssl_engine_vars.c
Date Mon, 12 Jan 2004 14:44:46 GMT
jorton      2004/01/12 06:44:46

  Modified:    .        Tag: APACHE_2_0_BRANCH CHANGES STATUS
               modules/ssl Tag: APACHE_2_0_BRANCH ssl_engine_vars.c
  Log:
  * modules/ssl/ssl_engine_vars.c (ssl_var_lookup): Only call
  ssl_var_lookup_ssl for a real SSL connection; fix lookup of "HTTPS"
  for non-SSL connections.
  (ssl_var_log_handler_x): Give results for non-SSL connections too;
  e.g. %{HTTPS}x does the right thing.
  (ssl_var_log_handler_c): Fix segfault on a non-SSL request.
  
  PR: 22741, 20852
  Submitted by: Gary E. Miller <gem@rellim.com>, Joe Orton
  Reviewed by: André Malo, Jeff Trawick
  
  Revision  Changes    Path
  No                   revision
  No                   revision
  1.988.2.214 +3 -0      httpd-2.0/CHANGES
  
  Index: CHANGES
  ===================================================================
  RCS file: /home/cvs/httpd-2.0/CHANGES,v
  retrieving revision 1.988.2.213
  retrieving revision 1.988.2.214
  diff -b -d -u -r1.988.2.213 -r1.988.2.214
  --- CHANGES	12 Jan 2004 14:30:13 -0000	1.988.2.213
  +++ CHANGES	12 Jan 2004 14:44:45 -0000	1.988.2.214
  @@ -1,5 +1,8 @@
   Changes with Apache 2.0.49
   
  +  *) mod_ssl: Fix segfault on a non-SSL request if the the 'c' log
  +     format code is used.  PR 22741.  [Gary E. Miller <gem rellim.com>]
  +
     *) Fix build with parallel make.  PR 24643.  [Joe Orton]
   
     *) mod_rewrite: In external rewrite maps lookup keys containing
  
  
  
  1.751.2.627 +1 -8      httpd-2.0/STATUS
  
  Index: STATUS
  ===================================================================
  RCS file: /home/cvs/httpd-2.0/STATUS,v
  retrieving revision 1.751.2.626
  retrieving revision 1.751.2.627
  diff -b -d -u -r1.751.2.626 -r1.751.2.627
  --- STATUS	12 Jan 2004 14:37:47 -0000	1.751.2.626
  +++ STATUS	12 Jan 2004 14:44:46 -0000	1.751.2.627
  @@ -99,13 +99,6 @@
         32/64 bit type mismatches in the file size.
         server/core.c r1.255, r1.256
         +1: bnicholes, nd
  -      
  -    * mod_ssl: Fix ssl_var_lookup for non-SSL requests, and logging of SSL
  -      variables from non-SSL connections.
  -      http://cvs.apache.org/viewcvs.cgi/httpd-2.0/modules/ssl/ssl_engine_vars.c?r1=1.24&r2=1.25
  -      http://cvs.apache.org/viewcvs.cgi/httpd-2.0/modules/ssl/ssl_engine_vars.c?r1=1.26&r2=1.28
  -      PR: 22741, 20852  (<= not 23956 as the commit message says)
  -      +1: jorton, nd, trawick
   
       * mod_ssl: Determine library version string at run-time rather than compile-time.
         http://cvs.apache.org/viewcvs.cgi/httpd-2.0/modules/ssl/ssl_engine_vars.c?r1=1.25&r2=1.26
  
  
  
  No                   revision
  No                   revision
  1.22.2.4  +7 -9      httpd-2.0/modules/ssl/ssl_engine_vars.c
  
  Index: ssl_engine_vars.c
  ===================================================================
  RCS file: /home/cvs/httpd-2.0/modules/ssl/ssl_engine_vars.c,v
  retrieving revision 1.22.2.3
  retrieving revision 1.22.2.4
  diff -b -d -u -r1.22.2.3 -r1.22.2.4
  --- ssl_engine_vars.c	1 Jan 2004 13:30:41 -0000	1.22.2.3
  +++ ssl_engine_vars.c	12 Jan 2004 14:44:46 -0000	1.22.2.4
  @@ -87,9 +87,9 @@
       return;
   }
   
  +/* This function must remain safe to use for a non-SSL connection. */
   char *ssl_var_lookup(apr_pool_t *p, server_rec *s, conn_rec *c, request_rec *r, char *var)
   {
  -    SSLConnRec *sslconn;
       SSLModConfigRec *mc = myModConfig(s);
       char *result;
       BOOL resdup;
  @@ -169,17 +169,18 @@
        * Connection stuff
        */
       if (result == NULL && c != NULL) {
  -        sslconn = myConnConfig(c);
  +        SSLConnRec *sslconn = myConnConfig(c);
           if (strcEQ(var, "REMOTE_ADDR"))
               result = c->remote_ip;
           else if (strcEQ(var, "REMOTE_USER"))
               result = r->user;
           else if (strcEQ(var, "AUTH_TYPE"))
               result = r->ap_auth_type;
  -        else if (strlen(var) > 4 && strcEQn(var, "SSL_", 4))
  +        else if (strlen(var) > 4 && strcEQn(var, "SSL_", 4) 
  +                 && sslconn && sslconn->ssl)
               result = ssl_var_lookup_ssl(p, c, var+4);
           else if (strcEQ(var, "HTTPS")) {
  -            if (sslconn->ssl != NULL)
  +            if (sslconn && sslconn->ssl)
                   result = "on";
               else
                   result = "off";
  @@ -655,7 +656,7 @@
       SSLConnRec *sslconn = myConnConfig(r->connection);
       char *result;
   
  -    if (sslconn->ssl == NULL)
  +    if (sslconn == NULL || sslconn->ssl == NULL)
           return NULL;
       result = NULL;
       if (strEQ(a, "version"))
  @@ -681,11 +682,8 @@
    */
   static const char *ssl_var_log_handler_x(request_rec *r, char *a)
   {
  -    SSLConnRec *sslconn = myConnConfig(r->connection);
       char *result;
   
  -    result = NULL;
  -    if (sslconn && sslconn->ssl)
           result = ssl_var_lookup(r->pool, r->server, r->connection, r, a);
       if (result != NULL && result[0] == NUL)
           result = NULL;
  
  
  

Mime
View raw message