Commit 9e48786e authored by Andre Malo's avatar Andre Malo
Browse files

bust the "recursive include" test. It's no longer necessary and

prevents users from careful use of the feature.

Reviewed by: Justin Erenkrantz, Joe Orton


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/APACHE_2_0_BRANCH@104865 13f79535-47bb-0310-9956-ffa450edef68
parent d4ef03d6
Loading
Loading
Loading
Loading
+4 −0
Changes for CHANGES: 4 added lines, 0 removed lines.
Original line number Diff line number Diff line
Changes with Apache 2.0.51
  *) mod_include no longer checks for recursion, because that's done
     in the core. This allows for carefully usage of recursive SSI.
     [André Malo]
  *) Fix memory leak in the cache handling of mod_rewrite. PR 27862.
     [chunyan sheng <shengperson yahoo.com>, André Malo]
+1 −13
Changes for STATUS: 1 added line, 13 removed lines.
Original line number Diff line number Diff line
APACHE 2.0 STATUS:                                              -*-text-*-
Last modified at [$Date: 2004/08/27 19:23:24 $]
Last modified at [$Date: 2004/08/27 19:41:21 $]

Release:

@@ -162,18 +162,6 @@ PATCHES TO BACKPORT FROM 2.1
         http://cvs.apache.org/viewcvs.cgi/httpd-2.0/modules/loggers/mod_log_config.c?r1=1.118&r2=1.119
       +1: trawick, nd, jerenkrantz

    *) mod_include: remove "recursive-include" check, it's no longer
       necessary and forbids legal actions.
          modules/filters/mod_include.c: r1.296
       jerenkrantz: ISTR, we forbid recursive checks elsewhere, but I've
                    completely forgotten where.
        nd: we stop recursions in the core now (for subrequests and internal
            redirects). Therefore the check here is no longer necessary.
       jerenkrantz: Aha.  ap_is_recursion_limit_exceeded() is the function
                    I was thinking of, but couldn't find.  (I was searching for
                    'recursive' not 'recursion'.)
       +1: nd, jerenkrantz, jorton

    *) mod_dav: Send an EOS at the end of the multistatus brigade.
       http://cvs.apache.org/viewcvs.cgi/httpd-2.0/modules/dav/main/mod_dav.c?r1=1.105&r2=1.106
       +1: jorton, jerenkrantz
+0 −44
Changes for modules/filters/mod_include.c: 0 added lines, 44 removed lines.
Original line number Diff line number Diff line
@@ -770,50 +770,6 @@ static int handle_include(include_ctx_t *ctx, apr_bucket_brigade **bb,
                    error_fmt = "unable to include potential exec \"%s\" "
                        "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;
                    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 && 
                                (strcmp(q->filename, rr->filename) == 0)) ||
                                ((*q->uri == '/') && 
                                 (strcmp(q->uri, rr->uri) == 0)))
                            {
                                founddupe = 1;
                                break;
                            }
                        }
                    }

                    if (p != NULL) {
                        error_fmt = "Recursive include of \"%s\" "
                            "in parsed file %s";
                    }
                }

                /* See the Kludge in send_parsed_file for why */
                /* Basically, it puts a bread crumb in here, then looks */