httpd-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From grega...@apache.org
Subject cvs commit: httpd-2.0/server request.c
Date Sat, 26 Jan 2002 20:16:01 GMT
gregames    02/01/26 12:16:01

  Modified:    server   request.c
  Log:
  ap_sub_req_lookup_dirent: fix mod_negotiation loop with near infinite
  subrequests
  
  this function has been creating bogus subrequest URIs when there is
  path_info for a long time.  They didn't matter until fixup_dir started
  using them for URI subrequests, which led to a loop with ever growing
  bogus internal URIs and filenames.
  
  Revision  Changes    Path
  1.95      +12 -1     httpd-2.0/server/request.c
  
  Index: request.c
  ===================================================================
  RCS file: /home/cvs/httpd-2.0/server/request.c,v
  retrieving revision 1.94
  retrieving revision 1.95
  diff -u -r1.94 -r1.95
  --- request.c	21 Jan 2002 01:43:30 -0000	1.94
  +++ request.c	26 Jan 2002 20:16:01 -0000	1.95
  @@ -84,6 +84,7 @@
   #include "http_main.h"
   #include "util_filter.h"
   #include "util_charset.h"
  +#include "util_script.h"
   
   #include "mod_core.h"
   
  @@ -1589,7 +1590,17 @@
       /* Special case: we are looking at a relative lookup in the same directory. 
        * This is 100% safe, since dirent->name just came from the filesystem.
        */
  -    udir = ap_make_dirstr_parent(rnew->pool, r->uri);
  +    if (r->path_info && *r->path_info) {
  +        /* strip path_info off the end of the uri to keep it in sync
  +         * with r->filename, which has already been stripped by directory_walk
  +         */
  +        udir = apr_pstrdup(rnew->pool, r->uri);
  +        udir[ap_find_path_info(udir, r->path_info)] = '\0';
  +        udir = ap_make_dirstr_parent(rnew->pool, udir);
  +    }
  +    else {
  +        udir = ap_make_dirstr_parent(rnew->pool, r->uri);
  +    }
       rnew->uri = ap_make_full_path(rnew->pool, udir, dirent->name);
       fdir = ap_make_dirstr_parent(rnew->pool, r->filename);
       rnew->filename = ap_make_full_path(rnew->pool, fdir, dirent->name);
  
  
  

Mime
View raw message