mirror of
https://github.com/owasp-modsecurity/ModSecurity.git
synced 2025-09-30 11:44:32 +03:00
SecUnicodeMapFile now accepts the code page. SecUnicodeCodePage is deprecated
This commit is contained in:
@@ -2656,6 +2656,8 @@ static const char *cmd_geo_lookup_db(cmd_parms *cmd, void *_dcfg,
|
|||||||
/**
|
/**
|
||||||
* \brief Add SecUnicodeCodePage configuration option
|
* \brief Add SecUnicodeCodePage configuration option
|
||||||
*
|
*
|
||||||
|
* Depcrecated
|
||||||
|
*
|
||||||
* \param cmd Pointer to configuration data
|
* \param cmd Pointer to configuration data
|
||||||
* \param _dcfg Pointer to directory configuration
|
* \param _dcfg Pointer to directory configuration
|
||||||
* \param p1 Pointer to configuration option
|
* \param p1 Pointer to configuration option
|
||||||
@@ -2688,13 +2690,24 @@ static const char *cmd_unicode_codepage(cmd_parms *cmd,
|
|||||||
* \retval NULL On success
|
* \retval NULL On success
|
||||||
*/
|
*/
|
||||||
static const char *cmd_unicode_map(cmd_parms *cmd, void *_dcfg,
|
static const char *cmd_unicode_map(cmd_parms *cmd, void *_dcfg,
|
||||||
const char *p1)
|
const char *p1, const char *p2)
|
||||||
{
|
{
|
||||||
const char *filename = resolve_relative_path(cmd->pool, cmd->directive->filename, p1);
|
const char *filename = resolve_relative_path(cmd->pool, cmd->directive->filename, p1);
|
||||||
char *error_msg;
|
char *error_msg;
|
||||||
|
long val = 0;
|
||||||
directory_config *dcfg = (directory_config *)_dcfg;
|
directory_config *dcfg = (directory_config *)_dcfg;
|
||||||
if (dcfg == NULL) return NULL;
|
if (dcfg == NULL) return NULL;
|
||||||
|
|
||||||
|
if(p2 != NULL) {
|
||||||
|
val = atol(p2);
|
||||||
|
if (val <= 0) {
|
||||||
|
return apr_psprintf(cmd->pool, "ModSecurity: Invalid setting for "
|
||||||
|
"SecUnicodeMapFile: %s", p2);
|
||||||
|
}
|
||||||
|
|
||||||
|
unicode_codepage = (unsigned long int)val;
|
||||||
|
}
|
||||||
|
|
||||||
if (unicode_map_init(dcfg, filename, &error_msg) <= 0) {
|
if (unicode_map_init(dcfg, filename, &error_msg) <= 0) {
|
||||||
return error_msg;
|
return error_msg;
|
||||||
}
|
}
|
||||||
@@ -3069,7 +3082,7 @@ const command_rec module_directives[] = {
|
|||||||
"Unicode CodePage"
|
"Unicode CodePage"
|
||||||
),
|
),
|
||||||
|
|
||||||
AP_INIT_TAKE1 (
|
AP_INIT_TAKE12 (
|
||||||
"SecUnicodeMapFile",
|
"SecUnicodeMapFile",
|
||||||
cmd_unicode_map,
|
cmd_unicode_map,
|
||||||
NULL,
|
NULL,
|
||||||
|
Reference in New Issue
Block a user