From 7acf6862b62ba0f6b8675d816e452cde87cf2ce3 Mon Sep 17 00:00:00 2001 From: Jim Jagielski Date: Mon, 17 Dec 2012 11:49:56 +0000 Subject: [PATCH] Merge r1406493, r1406495 from trunk: Make sections in virtual host context fill in cmd->path so that other directive notice that they are in a config section. This fixes LogLevel not working in sections that are not in Location/Directory/File sections. Make ap_check_cmd_context() treat sections like sections. This is necessary to properly disallow directives that don't work in . A separate NOT_IN_IF flag may be nicer, but would create much more hassle when being backported to 2.4. Submitted by: sf Reviewed/backported by: jim git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/2.4.x@1422877 13f79535-47bb-0310-9956-ffa450edef68 --- CHANGES | 8 ++++++++ STATUS | 16 ---------------- include/http_config.h | 6 +++--- server/core.c | 11 +++++++++-- 4 files changed, 20 insertions(+), 21 deletions(-) diff --git a/CHANGES b/CHANGES index a1be9216c0..40e0228971 100644 --- a/CHANGES +++ b/CHANGES @@ -2,6 +2,14 @@ Changes with Apache 2.4.4 + *) Be more correct about rejecting directives that cannot work in + sections. [Stefan Fritsch] + + *) core: Fix directives like LogLevel that need to know if they are invoked + at virtual host context or in Directory/Files/Location/If sections to + work properly in If sections that are not in a Directory/Files/Location. + [Stefan Fritsch] + *) mod_xml2enc: Fix problems with charset conversion altering the Content-Length. [Micha Lenk ] diff --git a/STATUS b/STATUS index 7520105a4a..8db7d7b79b 100644 --- a/STATUS +++ b/STATUS @@ -91,22 +91,6 @@ RELEASE SHOWSTOPPERS: PATCHES ACCEPTED TO BACKPORT FROM TRUNK: [ start all new proposals below, under PATCHES PROPOSED. ] - * : - - Make sections in virtual host context fill in cmd->path so that - other directive notice that they are in a config section. - Fixes directives like LogLevel that need to know if they are invoked - at virtual host context or in Directory/Files/Location/If sections to - work properly in If sections that are not in a Directory/Files/Location. - - Make ap_check_cmd_context() treat sections like sections. - This is necessary to properly disallow directives that don't work in - . - A separate NOT_IN_IF flag may be nicer, but would create much more - hassle when being backported to 2.4. - trunk patch: http://svn.apache.org/viewvc?view=revision&revision=1406493 - http://svn.apache.org/viewvc?view=revision&revision=1406495 - 2.4.x patch: Trunk patchs work. - +1: rjung, sf, jim - * mod_cache: Install cache_common.h as required by mod_cache.h. Allows external modules to use mod_cache. trunk patch: http://svn.apache.org/viewvc?rev=1422855&view=rev diff --git a/include/http_config.h b/include/http_config.h index 617ab2a682..7ee3760d98 100644 --- a/include/http_config.h +++ b/include/http_config.h @@ -901,11 +901,11 @@ AP_DECLARE(const char *) ap_check_cmd_context(cmd_parms *cmd, #define NOT_IN_LIMIT 0x02 /**< Forbidden in <Limit> */ #define NOT_IN_DIRECTORY 0x04 /**< Forbidden in <Directory> */ #define NOT_IN_LOCATION 0x08 /**< Forbidden in <Location> */ -#define NOT_IN_FILES 0x10 /**< Forbidden in <Files> */ +#define NOT_IN_FILES 0x10 /**< Forbidden in <Files> or <If>*/ #define NOT_IN_HTACCESS 0x20 /**< Forbidden in .htaccess files */ -/** Forbidden in <Directory>/<Location>/<Files>*/ +/** Forbidden in <Directory>/<Location>/<Files><If>*/ #define NOT_IN_DIR_LOC_FILE (NOT_IN_DIRECTORY|NOT_IN_LOCATION|NOT_IN_FILES) -/** Forbidden in <VirtualHost>/<Limit>/<Directory>/<Location>/<Files> */ +/** Forbidden in <VirtualHost>/<Limit>/<Directory>/<Location>/<Files>/<If> */ #define GLOBAL_ONLY (NOT_IN_VIRTUALHOST|NOT_IN_LIMIT|NOT_IN_DIR_LOC_FILE) /** @} */ diff --git a/server/core.c b/server/core.c index a09c8a05cb..c94bc3eb62 100644 --- a/server/core.c +++ b/server/core.c @@ -1144,7 +1144,10 @@ AP_DECLARE(const char *) ap_check_cmd_context(cmd_parms *cmd, || (found = find_parent(cmd->directive, "directive, "directive, "directive, "directive, "directive, "directive, "pool, cmd->cmd->name, gt, " cannot occur within ", found->directive, "> section", NULL); @@ -2354,7 +2357,11 @@ static const char *ifsection(cmd_parms *cmd, void *mconfig, const char *arg) arg = apr_pstrndup(cmd->temp_pool, arg, endp - arg); - + /* + * Set a dummy value so that other directives notice that they are inside + * a config section. + */ + cmd->path = "*If"; /* Only if not an .htaccess file */ if (!old_path) { cmd->override = OR_ALL|ACCESS_CONF; -- 2.40.0