Merge 2.5.x changes into trunk.

This commit is contained in:
b1v1r 2009-05-21 06:26:26 +00:00
parent ffc5d968e6
commit 12b9bcd33a
2 changed files with 11 additions and 1 deletions

View File

@ -1,6 +1,9 @@
20 May 2009 - trunk
-------------------
* Truncate long parameters in log message for "Match of ... against ...
required" messages.
* Correctly resolve chained rule actions in logs.
* Cleanup some code for portability.

View File

@ -1762,9 +1762,16 @@ static int execute_operator(msre_var *var, msre_rule *rule, modsec_rec *msr,
else {
/* Match. */
if (rc == 0) {
char *op_param = log_escape(msr->mp, rule->op_param);
/* Truncate op parameter. */
if (strlen(op_param) > 252) {
op_param = apr_psprintf(msr->mp, "%.252s ...", op_param);
}
/* Operator did not match so we need to provide a message. */
my_error_msg = apr_psprintf(msr->mp, "Match of \"%s %s\" against \"%s\" required.",
log_escape(msr->mp, rule->op_name), log_escape(msr->mp, rule->op_param),
log_escape(msr->mp, rule->op_name), op_param,
log_escape(msr->mp, full_varname));
}