mirror of
https://github.com/owasp-modsecurity/ModSecurity.git
synced 2026-01-14 07:27:09 +03:00
Cleanup. See #364.
This commit is contained in:
@@ -538,7 +538,7 @@ void init_directory_config(directory_config *dcfg) {
|
|||||||
if (dcfg->cache_trans_incremental == NOT_SET) dcfg->cache_trans_incremental = 0;
|
if (dcfg->cache_trans_incremental == NOT_SET) dcfg->cache_trans_incremental = 0;
|
||||||
if (dcfg->cache_trans_min == (apr_size_t)NOT_SET) dcfg->cache_trans_min = 32;
|
if (dcfg->cache_trans_min == (apr_size_t)NOT_SET) dcfg->cache_trans_min = 32;
|
||||||
if (dcfg->cache_trans_max == (apr_size_t)NOT_SET) dcfg->cache_trans_max = 1024;
|
if (dcfg->cache_trans_max == (apr_size_t)NOT_SET) dcfg->cache_trans_max = 1024;
|
||||||
if (dcfg->cache_trans_maxitems == (apr_size_t)NOT_SET) dcfg->cache_trans_maxitems = 1024;
|
if (dcfg->cache_trans_maxitems == (apr_size_t)NOT_SET) dcfg->cache_trans_maxitems = 512;
|
||||||
|
|
||||||
if (dcfg->request_encoding == NOT_SET_P) dcfg->request_encoding = NULL;
|
if (dcfg->request_encoding == NOT_SET_P) dcfg->request_encoding = NULL;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -314,7 +314,6 @@ apr_status_t modsecurity_tx_init(modsec_rec *msr) {
|
|||||||
/* Other */
|
/* Other */
|
||||||
msr->tcache = NULL;
|
msr->tcache = NULL;
|
||||||
msr->tcache_items = 0;
|
msr->tcache_items = 0;
|
||||||
msr->tcache_limit_warn = 0;
|
|
||||||
|
|
||||||
msr->matched_rules = apr_array_make(msr->mp, 16, sizeof(void *));
|
msr->matched_rules = apr_array_make(msr->mp, 16, sizeof(void *));
|
||||||
if (msr->matched_rules == NULL) return -1;
|
if (msr->matched_rules == NULL) return -1;
|
||||||
|
|||||||
@@ -366,7 +366,6 @@ struct modsec_rec {
|
|||||||
/* data cache */
|
/* data cache */
|
||||||
apr_hash_t *tcache;
|
apr_hash_t *tcache;
|
||||||
apr_size_t tcache_items;
|
apr_size_t tcache_items;
|
||||||
int tcache_limit_warn;
|
|
||||||
|
|
||||||
/* removed rules */
|
/* removed rules */
|
||||||
apr_array_header_t *removed_rules;
|
apr_array_header_t *removed_rules;
|
||||||
|
|||||||
12
apache2/re.c
12
apache2/re.c
@@ -2149,9 +2149,15 @@ static apr_status_t msre_rule_process_normal(msre_rule *rule, modsec_rec *msr) {
|
|||||||
if ((msr->txcfg->cache_trans_maxitems != 0) &&
|
if ((msr->txcfg->cache_trans_maxitems != 0) &&
|
||||||
(msr->tcache_items >= msr->txcfg->cache_trans_maxitems))
|
(msr->tcache_items >= msr->txcfg->cache_trans_maxitems))
|
||||||
{
|
{
|
||||||
msr_log(msr, 4, "CACHE: Disabled - maxitems=%" APR_SIZE_T_FMT
|
/* Warn only once if we attempt to go over the cache limit. */
|
||||||
" limit reached.",
|
if (msr->tcache_items == msr->txcfg->cache_trans_maxitems) {
|
||||||
msr->txcfg->cache_trans_maxitems);
|
msr->tcache_items++;
|
||||||
|
msr_log(msr, 4, "CACHE: Disabled - phase=%d"
|
||||||
|
" maxitems=%" APR_SIZE_T_FMT
|
||||||
|
" limit reached.",
|
||||||
|
msr->phase,
|
||||||
|
msr->txcfg->cache_trans_maxitems);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else if (msr->txcfg->cache_trans_incremental ||
|
else if (msr->txcfg->cache_trans_incremental ||
|
||||||
(tfnsnum == tarr->nelts))
|
(tfnsnum == tarr->nelts))
|
||||||
|
|||||||
@@ -166,8 +166,8 @@
|
|||||||
SecRule ARGS "foobar" "phase:4,t:none,t:removeWhiteSpace,t:lowercase,deny"
|
SecRule ARGS "foobar" "phase:4,t:none,t:removeWhiteSpace,t:lowercase,deny"
|
||||||
),
|
),
|
||||||
match_log => {
|
match_log => {
|
||||||
debug => [ qr/Adding request argument \(BODY\): name "test", value "foobar"/, 15 ],
|
debug => [ qr/Adding request argument \(BODY\): name "test", value "foobar"/, 60 ],
|
||||||
-error => [ qr/segmentation fault/i, 15 ],
|
-error => [ qr/segmentation fault/i, 60 ],
|
||||||
},
|
},
|
||||||
match_response => {
|
match_response => {
|
||||||
status => qr/^403$/,
|
status => qr/^403$/,
|
||||||
|
|||||||
@@ -23,6 +23,8 @@
|
|||||||
|
|
||||||
ServerName localhost
|
ServerName localhost
|
||||||
|
|
||||||
|
CoreDumpDirectory @MSC_REGRESSION_SERVERROOT_DIR@/tmp
|
||||||
|
|
||||||
LogLevel debug
|
LogLevel debug
|
||||||
ErrorLog @MSC_REGRESSION_LOGS_DIR@/error.log
|
ErrorLog @MSC_REGRESSION_LOGS_DIR@/error.log
|
||||||
|
|
||||||
|
|||||||
@@ -909,7 +909,7 @@ SecAuditLogStorageDir logs/audit
|
|||||||
more than N transformations to be cached. The cache will then be
|
more than N transformations to be cached. The cache will then be
|
||||||
disabled. A zero value is interpreted as "unlimited". This option
|
disabled. A zero value is interpreted as "unlimited". This option
|
||||||
may be useful to limit caching for a form with a large number of
|
may be useful to limit caching for a form with a large number of
|
||||||
ARGS. (default: 1024)</para>
|
ARGS. (default: 512)</para>
|
||||||
</listitem>
|
</listitem>
|
||||||
|
|
||||||
<listitem>
|
<listitem>
|
||||||
|
|||||||
Reference in New Issue
Block a user