From aef091a8491852470f71f5c3c2eb3c0db2fb7360 Mon Sep 17 00:00:00 2001 From: brectanus Date: Fri, 15 Feb 2008 23:05:30 +0000 Subject: [PATCH] Reverted r950 which moved the periods from the message to after the "[offset ...]" tag. This tag was intended to be interpreted as metadata. Enhanced the documentation from r951 to reflect "[offset ...]" as metadata and not the message. --- apache2/re_operators.c | 14 +++++++------- doc/modsecurity2-apache-reference.xml | 24 ++++++++++++++---------- 2 files changed, 21 insertions(+), 17 deletions(-) diff --git a/apache2/re_operators.c b/apache2/re_operators.c index 00a22e7d..494b2449 100644 --- a/apache2/re_operators.c +++ b/apache2/re_operators.c @@ -1134,7 +1134,7 @@ static int msre_op_verifyCC_execute(modsec_rec *msr, msre_rule *rule, msre_var * /* Match. */ /* This message will be logged. */ - *error_msg = apr_psprintf(msr->mp, "CC# match \"%s\" at %s [offset \"%d\"].", + *error_msg = apr_psprintf(msr->mp, "CC# match \"%s\" at %s. [offset \"%d\"]", regex->pattern, var->name, offset); return 1; @@ -1669,30 +1669,30 @@ static int msre_op_validateUtf8Encoding_execute(modsec_rec *msr, msre_rule *rule case UNICODE_ERROR_CHARACTERS_MISSING : *error_msg = apr_psprintf(msr->mp, "Invalid UTF-8 encoding: " "not enough bytes in character " - "at %s [offset \"%d\"].", var->name, i); + "at %s. [offset \"%d\"]", var->name, i); return 1; break; case UNICODE_ERROR_INVALID_ENCODING : *error_msg = apr_psprintf(msr->mp, "Invalid UTF-8 encoding: " "invalid byte value in character " - "at %s [offset \"%d\"].", var->name, i); + "at %s. [offset \"%d\"]", var->name, i); return 1; break; case UNICODE_ERROR_OVERLONG_CHARACTER : *error_msg = apr_psprintf(msr->mp, "Invalid UTF-8 encoding: " "overlong character detected " - "at %s [offset \"%d\"].", var->name, i); + "at %s. [offset \"%d\"]", var->name, i); return 1; break; case UNICODE_ERROR_RESTRICTED_CHARACTER : *error_msg = apr_psprintf(msr->mp, "Invalid UTF-8 encoding: " "use of restricted character " - "at %s [offset \"%d\"].", var->name, i); + "at %s. [offset \"%d\"]", var->name, i); return 1; break; case UNICODE_ERROR_DECODING_ERROR : - *error_msg = apr_psprintf(msr->mp, "Invalid UTF-8 encoding: decoding error " - "at %s [offset \"%d\"].", var->name, i); + *error_msg = apr_psprintf(msr->mp, "Error validating UTF-8 decoding " + "at %s. [offset \"%d\"]", var->name, i); return 1; break; } diff --git a/doc/modsecurity2-apache-reference.xml b/doc/modsecurity2-apache-reference.xml index 53f627fe..b24a67dc 100644 --- a/doc/modsecurity2-apache-reference.xml +++ b/doc/modsecurity2-apache-reference.xml @@ -5599,33 +5599,32 @@ against "REQUEST_PROTOCOL" required. Invalid UTF-8 encoding: not enough bytes in character at - %0 [offset %1]. + %0. Invalid UTF-8 encoding: invalid byte value in character at - %0 [offset %1]. + %0. - Invalid UTF-8 encoding: overlong character detected at %0 - [offset %1]. + Invalid UTF-8 encoding: overlong character detected at + %0. - Invalid UTF-8 encoding: use of restricted character at %0 - [offset %1]. + Invalid UTF-8 encoding: use of restricted character at + %0. - Invalid UTF-8 encoding: decoding error at %0 [offset - %1]. + Invalid UTF-8 encoding: decoding error at %0. - @verifyCC - CC# match %0 at %1 [offset %2]. + @verifyCC - CC# match %0 at %1. @@ -5654,6 +5653,11 @@ against "REQUEST_PROTOCOL" required. The following metadata fields are currently used: + + offset - The byte offset where a match + occured within the target data. This is not always available. + + id - Unique rule ID, as specified by the id action. @@ -5912,4 +5916,4 @@ Server: Apache/2.x.x - + \ No newline at end of file