summaryrefslogtreecommitdiff
path: root/server/config.c
diff options
context:
space:
mode:
authorNick Kew <niq@apache.org>2012-01-09 04:01:06 +0000
committerNick Kew <niq@apache.org>2012-01-09 04:01:06 +0000
commite0ddfe0fdfd50acd20f597d0ad51e9104971f35b (patch)
treeb94325699402da344f19d4b3f169c9a6a675dfa9 /server/config.c
parent29bf1ace3f2d6dc4296f25dcd6ddad142dc5097a (diff)
downloadhttpd-e0ddfe0fdfd50acd20f597d0ad51e9104971f35b.tar.gz
Core configuration: add AllowOverride option to treat syntax
errors in .htaccess as non-fatal. PR 52439 git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1229021 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'server/config.c')
-rw-r--r--server/config.c34
1 files changed, 27 insertions, 7 deletions
diff --git a/server/config.c b/server/config.c
index 409ca0695a..96ab9c9d57 100644
--- a/server/config.c
+++ b/server/config.c
@@ -848,8 +848,19 @@ static const char *invoke_cmd(const command_rec *cmd, cmd_parms *parms,
if(apr_table_get(parms->override_list, cmd->name) != NULL)
override_list_ok = 1;
- if ((parms->override & cmd->req_override) == 0 && !override_list_ok)
- return apr_pstrcat(parms->pool, cmd->name, " not allowed here", NULL);
+ if ((parms->override & cmd->req_override) == 0 && !override_list_ok) {
+ if (parms->override & NONFATAL_OVERRIDE) {
+ ap_log_perror(APLOG_MARK, APLOG_WARNING, 0, parms->temp_pool,
+ APLOGNO(02295)
+ "%s in .htaccess forbidden by AllowOverride",
+ cmd->name);
+ return NULL;
+ }
+ else {
+ return apr_pstrcat(parms->pool, cmd->name,
+ " not allowed here", NULL);
+ }
+ }
parms->info = cmd->cmd_data;
parms->cmd = cmd;
@@ -1251,11 +1262,20 @@ static const char *ap_walk_config_sub(const ap_directive_t *current,
if (ml == NULL) {
parms->err_directive = current;
- return apr_pstrcat(parms->pool, "Invalid command '",
- current->directive,
- "', perhaps misspelled or defined by a module "
- "not included in the server configuration",
- NULL);
+ if (parms->override & NONFATAL_UNKNOWN) {
+ ap_log_perror(APLOG_MARK, APLOG_WARNING, 0, parms->temp_pool,
+ APLOGNO(02296) "Unknown directive %s "
+ "perhaps misspelled or defined by a module "
+ "not included in the server configuration", dir);
+ return NULL;
+ }
+ else {
+ return apr_pstrcat(parms->pool, "Invalid command '",
+ current->directive,
+ "', perhaps misspelled or defined by a module "
+ "not included in the server configuration",
+ NULL);
+ }
}
for ( ; ml != NULL; ml = ml->next) {