From cvs-return-37410-apmail-httpd-cvs-archive=httpd.apache.org@httpd.apache.org Tue Dec 07 13:06:45 2010 Return-Path: Delivered-To: apmail-httpd-cvs-archive@www.apache.org Received: (qmail 35253 invoked from network); 7 Dec 2010 13:06:44 -0000 Received: from unknown (HELO mail.apache.org) (140.211.11.3) by 140.211.11.9 with SMTP; 7 Dec 2010 13:06:44 -0000 Received: (qmail 53355 invoked by uid 500); 7 Dec 2010 13:06:44 -0000 Delivered-To: apmail-httpd-cvs-archive@httpd.apache.org Received: (qmail 53244 invoked by uid 500); 7 Dec 2010 13:06:44 -0000 Mailing-List: contact cvs-help@httpd.apache.org; run by ezmlm Precedence: bulk Reply-To: dev@httpd.apache.org list-help: list-unsubscribe: List-Post: List-Id: Delivered-To: mailing list cvs@httpd.apache.org Received: (qmail 53237 invoked by uid 99); 7 Dec 2010 13:06:43 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 07 Dec 2010 13:06:43 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO eris.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 07 Dec 2010 13:06:42 +0000 Received: by eris.apache.org (Postfix, from userid 65534) id E42D223888D2; Tue, 7 Dec 2010 13:06:22 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: svn commit: r1043023 - in /httpd/httpd/trunk: CHANGES modules/http/http_request.c server/core.c Date: Tue, 07 Dec 2010 13:06:22 -0000 To: cvs@httpd.apache.org From: covener@apache.org X-Mailer: svnmailer-1.0.8 Message-Id: <20101207130622.E42D223888D2@eris.apache.org> Author: covener Date: Tue Dec 7 13:06:22 2010 New Revision: 1043023 URL: http://svn.apache.org/viewvc?rev=1043023&view=rev Log: PR50349: Honor 'AcceptPathInfo OFF' during internal redirects, such as per-directory mod_rewrite substitutions. This would be left floating around in the request_rec with a pcalloc'ed value, so the core fixup hook thought some module had overridden it. Modified: httpd/httpd/trunk/CHANGES httpd/httpd/trunk/modules/http/http_request.c httpd/httpd/trunk/server/core.c Modified: httpd/httpd/trunk/CHANGES URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/CHANGES?rev=1043023&r1=1043022&r2=1043023&view=diff ============================================================================== --- httpd/httpd/trunk/CHANGES [utf-8] (original) +++ httpd/httpd/trunk/CHANGES [utf-8] Tue Dec 7 13:06:22 2010 @@ -2,6 +2,10 @@ Changes with Apache 2.3.10 + *) core: Honor 'AcceptPathInfo OFF' during internal redirects, + such as per-directory mod_rewrite substitutions. PR 50349. + [Eric Covener] + *) mod_rewrite: Add 'RewriteOptions InheritBefore' to put the base rules/conditions before the overridden rules/conditions. PR 39313. [Jérôme Grandjanny ] Modified: httpd/httpd/trunk/modules/http/http_request.c URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/modules/http/http_request.c?rev=1043023&r1=1043022&r2=1043023&view=diff ============================================================================== --- httpd/httpd/trunk/modules/http/http_request.c (original) +++ httpd/httpd/trunk/modules/http/http_request.c Tue Dec 7 13:06:22 2010 @@ -521,6 +521,11 @@ static request_rec *internal_internal_re apr_table_setn(new->subprocess_env, "REDIRECT_STATUS", apr_itoa(r->pool, r->status)); + /* Begin by presuming any module can make its own path_info assumptions, + * until some module interjects and changes the value. + */ + new->used_path_info = AP_REQ_DEFAULT_PATH_INFO; + /* * XXX: hmm. This is because mod_setenvif and mod_unique_id really need * to do their thing on internal redirects as well. Perhaps this is a Modified: httpd/httpd/trunk/server/core.c URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/server/core.c?rev=1043023&r1=1043022&r2=1043023&view=diff ============================================================================== --- httpd/httpd/trunk/server/core.c (original) +++ httpd/httpd/trunk/server/core.c Tue Dec 7 13:06:22 2010 @@ -73,6 +73,9 @@ #define AP_MAX_INCLUDE_DEPTH (128) #endif +/* valid in core-conf, but not in runtime r->used_path_info */ +#define AP_ACCEPT_PATHINFO_UNSET 3 + APR_HOOK_STRUCT( APR_HOOK_LINK(get_mgmt_items) ) @@ -120,7 +123,7 @@ static void *create_core_dir_config(apr_ conf->override_opts = OPT_UNSET | OPT_ALL | OPT_SYM_OWNER | OPT_MULTI; conf->content_md5 = 2; - conf->accept_path_info = 3; + conf->accept_path_info = AP_ACCEPT_PATHINFO_UNSET; conf->use_canonical_name = USE_CANONICAL_NAME_UNSET; conf->use_canonical_phys_port = USE_CANONICAL_PHYS_PORT_UNSET; @@ -3759,15 +3762,17 @@ static int core_override_type(request_re /* Deal with the poor soul who is trying to force path_info to be * accepted within the core_handler, where they will let the subreq * address its contents. This is toggled by the user in the very - * beginning of the fixup phase, so modules should override the user's + * beginning of the fixup phase (here!), so modules should override the user's * discretion in their own module fixup phase. It is tristate, if - * the user doesn't specify, the result is 2 (which the module may - * interpret to its own customary behavior.) It won't be touched - * if the value is no longer undefined (2), so any module changing - * the value prior to the fixup phase OVERRIDES the user's choice. + * the user doesn't specify, the result is AP_REQ_DEFAULT_PATH_INFO. + * (which the module may interpret to its own customary behavior.) + * It won't be touched if the value is no longer AP_ACCEPT_PATHINFO_UNSET, + * so any module changing the value prior to the fixup phase + * OVERRIDES the user's choice. */ if ((r->used_path_info == AP_REQ_DEFAULT_PATH_INFO) - && (conf->accept_path_info != 3)) { + && (conf->accept_path_info != AP_ACCEPT_PATHINFO_UNSET)) { + /* No module knew better, and the user coded AcceptPathInfo */ r->used_path_info = conf->accept_path_info; }