httpd-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jwool...@apache.org
Subject cvs commit: httpd-2.0/modules/filters mod_include.c
Date Fri, 24 Aug 2001 04:50:49 GMT
jwoolley    01/08/23 21:50:49

  Modified:    modules/filters mod_include.c
  Log:
  Sanitize all the wacky indentation in this block prior to commiting
  the real fix.  No functional change.
  
  Revision  Changes    Path
  1.131     +33 -32    httpd-2.0/modules/filters/mod_include.c
  
  Index: mod_include.c
  ===================================================================
  RCS file: /home/cvs/httpd-2.0/modules/filters/mod_include.c,v
  retrieving revision 1.130
  retrieving revision 1.131
  diff -u -d -u -r1.130 -r1.131
  --- mod_include.c	2001/08/24 00:47:09	1.130
  +++ mod_include.c	2001/08/24 04:50:49	1.131
  @@ -830,41 +830,42 @@
                           "in parsed file %s";
                   }
                   if (error_fmt == NULL) {
  -    		/* try to avoid recursive includes.  We do this by walking
  -    		 * up the r->main list of subrequests, and at each level
  -    		 * walking back through any internal redirects.  At each
  -    		 * step, we compare the filenames and the URIs.  
  -    		 *
  -    		 * The filename comparison catches a recursive include
  -    		 * with an ever-changing URL, eg.
  -    		 * <!--#include virtual=
  -    		 *      "$REQUEST_URI/$QUERY_STRING?$QUERY_STRING/x"-->
  -    		 * which, although they would eventually be caught because
  -    		 * we have a limit on the length of files, etc., can 
  -    		 * recurse for a while.
  -    		 *
  -    		 * The URI comparison catches the case where the filename
  -    		 * is changed while processing the request, so the 
  -    		 * current name is never the same as any previous one.
  -    		 * This can happen with "DocumentRoot /foo" when you
  -    		 * request "/" on the server and it includes "/".
  -    		 * This only applies to modules such as mod_dir that 
  -    		 * (somewhat improperly) mess with r->filename outside 
  -    		 * of a filename translation phase.
  -    		 */
  -    		int founddupe = 0;
  +                    /* try to avoid recursive includes.  We do this by walking
  +                     * up the r->main list of subrequests, and at each level
  +                     * walking back through any internal redirects.  At each
  +                     * step, we compare the filenames and the URIs.  
  +                     *
  +                     * The filename comparison catches a recursive include
  +                     * with an ever-changing URL, eg.
  +                     * <!--#include virtual=
  +                     *      "$REQUEST_URI/$QUERY_STRING?$QUERY_STRING/x"-->
  +                     * which, although they would eventually be caught because
  +                     * we have a limit on the length of files, etc., can 
  +                     * recurse for a while.
  +                     *
  +                     * The URI comparison catches the case where the filename
  +                     * is changed while processing the request, so the 
  +                     * current name is never the same as any previous one.
  +                     * This can happen with "DocumentRoot /foo" when you
  +                     * request "/" on the server and it includes "/".
  +                     * This only applies to modules such as mod_dir that 
  +                     * (somewhat improperly) mess with r->filename outside 
  +                     * of a filename translation phase.
  +                     */
  +                    int founddupe = 0;
                       request_rec *p;
                       for (p = r; p != NULL && !founddupe; p = p->main) {
  -    		    request_rec *q;
  -    		    for (q = p; q != NULL; q = q->prev) {
  -                        if ((q->filename && rr->filename && 
  +                        request_rec *q;
  +                        for (q = p; q != NULL; q = q->prev) {
  +                            if ((q->filename && rr->filename && 
                                       (strcmp(q->filename, rr->filename) == 0)) ||
  -                                (strcmp(q->uri, rr->uri) == 0)) {
  -    			    founddupe = 1;
  -    			    break;
  -    			}
  -    		    }
  -    		}
  +                                (strcmp(q->uri, rr->uri) == 0))
  +                            {
  +                                founddupe = 1;
  +                                break;
  +                            }
  +                        }
  +                    }
   
                       if (p != NULL) {
                           error_fmt = "Recursive include of \"%s\" "
  
  
  

Mime
View raw message