From: Stefan Fritsch Date: Wed, 7 Nov 2012 08:33:05 +0000 (+0000) Subject: Make ap_check_cmd_context() treat sections like sections. X-Git-Tag: 2.5.0-alpha~6156 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=289ead8ef7efc306ceaaa0645ac898a6c31ecb9d;p=thirdparty%2Fapache%2Fhttpd.git 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. git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1406495 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/CHANGES b/CHANGES index ba2aef91a0a..e52da26a06c 100644 --- a/CHANGES +++ b/CHANGES @@ -1,6 +1,9 @@ -*- coding: utf-8 -*- Changes with Apache 2.5.0 + *) 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. diff --git a/include/http_config.h b/include/http_config.h index 9d6b013b5ea..52dce724025 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 818ddbfb518..bbaadd7d778 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);