MODSEC-362

This commit is contained in:
Breno Silva
2013-04-22 13:36:13 -04:00
parent 08471afafe
commit 6cd3a14db1
3 changed files with 61 additions and 3 deletions

View File

@@ -159,6 +159,9 @@ void *create_directory_config(apr_pool_t *mp, char *path)
/* xml external entity */
dcfg->xml_external_entity = NOT_SET;
/* remote addr define */
dcfg->remote_define = NOT_SET_P;
return dcfg;
}
@@ -598,6 +601,10 @@ void *merge_directory_configs(apr_pool_t *mp, void *_parent, void *_child)
merged->xml_external_entity = (child->xml_external_entity == NOT_SET
? parent->xml_external_entity : child->xml_external_entity);
/* remote add define */
merged->remote_define = (child->remote_define == NOT_SET_P
? parent->remote_define : child->remote_define);
return merged;
}
@@ -721,6 +728,9 @@ void init_directory_config(directory_config *dcfg)
/* xml external entity */
if (dcfg->xml_external_entity == NOT_SET) dcfg->xml_external_entity = 0;
/* remote addr define */
if (dcfg->remote_define == NOT_SET_P) dcfg->remote_define = "default";
}
/**
@@ -2286,6 +2296,15 @@ static const char *cmd_web_app_id(cmd_parms *cmd, void *_dcfg, const char *p1)
return NULL;
}
static const char *cmd_remote_addr_define(cmd_parms *cmd, void *_dcfg, const char *p1)
{
directory_config *dcfg = (directory_config *)_dcfg;
dcfg->remote_define = p1;
return NULL;
}
static const char *cmd_sensor_id(cmd_parms *cmd, void *_dcfg, const char *p1)
{
directory_config *dcfg = (directory_config *)_dcfg;
@@ -3475,6 +3494,14 @@ const command_rec module_directives[] = {
"id"
),
AP_INIT_TAKE1 (
"SecRemoteAddrDefine",
cmd_remote_addr_define,
NULL,
CMD_SCOPE_MAIN,
"Define a request header field to define remote addr"
),
AP_INIT_TAKE1 (
"SecSensorId",
cmd_sensor_id,