diff options
author | Yann Ylavic <ylavic@apache.org> | 2017-10-14 18:27:14 +0200 |
---|---|---|
committer | Yann Ylavic <ylavic@apache.org> | 2017-10-14 18:27:14 +0200 |
commit | 1ee7b9348bef4480fdc8b154bdd9bc2f023072d6 (patch) | |
tree | 8230c3d302182ed1005d5cb5d073d63833880f47 /include/http_config.h | |
parent | Follow up to r1809881: CHANGES entry. (diff) | |
download | apache2-1ee7b9348bef4480fdc8b154bdd9bc2f023072d6.tar.xz apache2-1ee7b9348bef4480fdc8b154bdd9bc2f023072d6.zip |
Follow up to r1740928: including NOT_IN_PROXY in NOT_IN_DIR_LOC_FILE is both
incomplete and not backportable, fix it by introducing NOT_IN_DIR_CONTEXT and
restoring NOT_IN_DIR_LOC_FILE to its previous value.
Per ap_check_cmd_context(), NOT_IN_DIR_LOC_FILE actually/really means "not in
any directory context", while the definition itself does not include all the
existing directory contexts (e.g. <Limit>, or <Proxy> before r1740928).
This is a bit of a misnomer, at least, so instead of (ab)using it by adding the
missing contexts (in an incompatible way), let's define NOT_IN_DIR_CONTEXT to
really exclude all directory context (i.e. NOT_IN_DIR_LOC_FILE + NOT_IN_LIMIT +
NOT_IN_PROXY) and use it wherever NOT_IN_DIR_LOC_FILE was used.
This is by itself a major MMN bump (modules not compiled with this commit and
having directives checked against NOT_IN_DIR_LOC_FILE won't be caught the same
way by NOT_IN_DIR_CONTEXT in the new ap_check_cmd_context() code), but with the
below change, 2.4.x should work as before:
- if ((forbidden & NOT_IN_DIR_CONTEXT) == NOT_IN_DIR_CONTEXT) {
+ if ((forbidden & NOT_IN_DIR_LOC_FILE) == NOT_IN_DIR_LOC_FILE) {
if (cmd->path != NULL) {
return apr_pstrcat(cmd->pool, cmd->cmd->name, gt,
- " cannot occur within directory context", NULL);
+ " cannot occur within <Directory/Location/Files/Proxy> "
+ "section", NULL);
}
...
}
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1812193 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'include/http_config.h')
-rw-r--r-- | include/http_config.h | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/include/http_config.h b/include/http_config.h index 37e0b382ab..549e1d16be 100644 --- a/include/http_config.h +++ b/include/http_config.h @@ -950,10 +950,12 @@ AP_DECLARE(const char *) ap_check_cmd_context(cmd_parms *cmd, #define NOT_IN_FILES 0x10 /**< Forbidden in <Files> or <If>*/ #define NOT_IN_HTACCESS 0x20 /**< Forbidden in .htaccess files */ #define NOT_IN_PROXY 0x40 /**< Forbidden in <Proxy> */ +/** Forbidden in <Directory>/<Location>/<Files><If>*/ +#define NOT_IN_DIR_LOC_FILE (NOT_IN_DIRECTORY|NOT_IN_LOCATION|NOT_IN_FILES) /** Forbidden in <Directory>/<Location>/<Files><If><Proxy>*/ -#define NOT_IN_DIR_LOC_FILE (NOT_IN_DIRECTORY|NOT_IN_LOCATION|NOT_IN_FILES|NOT_IN_PROXY) +#define NOT_IN_DIR_CONTEXT (NOT_IN_LIMIT|NOT_IN_DIR_LOC_FILE|NOT_IN_PROXY) /** Forbidden in <VirtualHost>/<Limit>/<Directory>/<Location>/<Files>/<If><Proxy>*/ -#define GLOBAL_ONLY (NOT_IN_VIRTUALHOST|NOT_IN_LIMIT|NOT_IN_DIR_LOC_FILE) +#define GLOBAL_ONLY (NOT_IN_VIRTUALHOST|NOT_IN_DIR_CONTEXT) /** @} */ |