From 6ca3e75ae04bab840db19db7dfce31044bbf2f1c Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Thu, 13 Dec 2001 16:11:41 +0000 Subject: [PATCH] If dconf->accept_path_info is tristate, why not r->used_path_info? This patch allows us to force path_info off in mod_cgi[d] etc, patch forthcoming. It also allows includes, php, etc to change the undefined value in the early handler or late fixup phases to Accept'ed. git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@92448 13f79535-47bb-0310-9956-ffa450edef68 --- server/core.c | 21 ++++++++++++++------- 1 file changed, 14 insertions(+), 7 deletions(-) diff --git a/server/core.c b/server/core.c index 6e73cc29c7..d334b27dd2 100644 --- a/server/core.c +++ b/server/core.c @@ -2684,14 +2684,16 @@ static int core_override_type(request_rec *r) /* 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 it's contents. This can only be toggled on by the user, - * and modules can't override the user's discresion, except in their - * own module fixup phase. + * address it's contents. This is toggled by the user in the very + * beginning of the fixup phase, so modules should override the user's + * discresion 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 it's own customary behavior.) It won't be tounched + * if the value is no longer undefined (2), so any module changing + * the value prior to the fixup phase OVERRIDES the user's choice. */ - if (!r->used_path_info & (conf->accept_path_info & 1)) { + if (r->used_path_info == 2) r->used_path_info = conf->accept_path_info; - } - return OK; } @@ -2754,7 +2756,7 @@ static int default_handler(request_rec *r) "File does not exist: %s", r->filename); return HTTP_NOT_FOUND; } - if (!r->used_path_info && r->path_info && *r->path_info) { + if (!(r->used_path_info & 1) && r->path_info && *r->path_info) { ap_log_rerror(APLOG_MARK, APLOG_ERR|APLOG_NOERRNO, 0, r, "File does not exist: %s", apr_pstrcat(r->pool, r->filename, r->path_info, NULL)); @@ -3396,6 +3398,11 @@ static int core_create_req(request_rec *r) } ap_add_input_filter("NET_TIME", NULL, r, r->connection); + + /* Begin by presuming any module can make it's own path_info assumptions, + * until some module interjects and changes the value. + */ + r->used_path_info = 2; return OK; } -- 2.40.0