From c559f3ee217946e4d7821ff7a7548261a10379ca Mon Sep 17 00:00:00 2001 From: brectanus Date: Thu, 3 May 2007 03:41:29 +0000 Subject: [PATCH] Change @eq to @streq. See #54. --- CHANGES | 2 +- apache2/re_operators.c | 8 +++---- doc/modsecurity2-apache-reference.xml | 32 +++++++++++++-------------- 3 files changed, 21 insertions(+), 21 deletions(-) diff --git a/CHANGES b/CHANGES index ae44ebd4..69175ecf 100644 --- a/CHANGES +++ b/CHANGES @@ -14,7 +14,7 @@ content type (e.g. HTML, plain text, etc). * Added string comparison operators with support for macro expansion: - @contains, @is, @beginsWith and @endsWith. + @contains, @streq, @beginsWith and @endsWith. * Enhanced debug log output to log macro expansion, quote values and correctly display values that contained NULs. diff --git a/apache2/re_operators.c b/apache2/re_operators.c index 62dccf86..fccfb217 100644 --- a/apache2/re_operators.c +++ b/apache2/re_operators.c @@ -238,9 +238,9 @@ static int msre_op_contains_execute(modsec_rec *msr, msre_rule *rule, msre_var * return 0; } -/* is */ +/* streq */ -static int msre_op_is_execute(modsec_rec *msr, msre_rule *rule, msre_var *var, char **error_msg) { +static int msre_op_streq_execute(modsec_rec *msr, msre_rule *rule, msre_var *var, char **error_msg) { msc_string *str = (msc_string *)apr_pcalloc(msr->mp, sizeof(msc_string)); const char *match = NULL; const char *target; @@ -1109,9 +1109,9 @@ void msre_engine_register_default_operators(msre_engine *engine) { /* is */ msre_engine_op_register(engine, - "is", + "streq", NULL, /* ENH init function to flag var substitution */ - msre_op_is_execute + msre_op_streq_execute ); /* startsWith */ diff --git a/doc/modsecurity2-apache-reference.xml b/doc/modsecurity2-apache-reference.xml index ea272a75..37c083e6 100644 --- a/doc/modsecurity2-apache-reference.xml +++ b/doc/modsecurity2-apache-reference.xml @@ -4019,22 +4019,6 @@ SecRule ARGS:route "!@endsWith %{REQUEST_ADDR}" role="bold">@inspectFile /opt/apache/bin/inspect_script.pl" -
- <literal>is</literal> - - Description: This operator is a - string comparison and returns true if the parameter value matches the - input exactly. Macro expansion is performed so you may use variable - names such as %{TX.1}, etc. - - Example: - - SecRule ARGS:foo "!@is bar" t:none,deny,status:403 -SecRule REQUEST_ADDR "^(.*)$" deny,status:403,capture,chain -SecRule REQUEST_HEADERS:Ip-Address "!@is %{TX.1}" -
-
<literal>le</literal> @@ -4115,6 +4099,22 @@ SecRule REQUEST_HEADERS:Ip-Address "!@is %{TX.1}
+
+ <literal>streq</literal> + + Description: This operator is a + string comparison and returns true if the parameter value matches the + input exactly. Macro expansion is performed so you may use variable + names such as %{TX.1}, etc. + + Example: + + SecRule ARGS:foo "!@streq bar" t:none,deny,status:403 +SecRule REQUEST_ADDR "^(.*)$" deny,status:403,capture,chain +SecRule REQUEST_HEADERS:Ip-Address "!@streq %{TX.1}" +
+
<literal>validateByteRange</literal>