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.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@
1406495 13f79535-47bb-0310-9956-
ffa450edef68
-*- coding: utf-8 -*-
Changes with Apache 2.5.0
+ *) 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.
#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);