Make <If> 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 <If> sections that are not in
Location/Directory/File sections.
Make ap_check_cmd_context() treat <If> sections like <File> sections.
This is necessary to properly disallow directives that don't work in
<If>.
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 with Apache 2.4.4
+ *) Be more correct about rejecting directives that cannot work in <If>
+ 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 <micha lenk info>]
PATCHES ACCEPTED TO BACKPORT FROM TRUNK:
[ start all new proposals below, under PATCHES PROPOSED. ]
- * <If>:
- - Make <If> 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 <If> sections like <File> sections.
- This is necessary to properly disallow directives that don't work in
- <If>.
- 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
#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)
/** @} */
|| (found = find_parent(cmd->directive, "<LocationMatch"))))
|| ((forbidden & NOT_IN_FILES)
&& ((found = find_parent(cmd->directive, "<Files"))
- || (found = find_parent(cmd->directive, "<FilesMatch"))))) {
+ || (found = find_parent(cmd->directive, "<FilesMatch"))
+ || (found = find_parent(cmd->directive, "<If"))
+ || (found = find_parent(cmd->directive, "<ElseIf"))
+ || (found = find_parent(cmd->directive, "<Else"))))) {
return apr_pstrcat(cmd->pool, cmd->cmd->name, gt,
" cannot occur within ", found->directive,
"> section", NULL);
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;