This commit is contained in:
brectanus 2007-05-03 03:41:29 +00:00
Родитель 2aa6e61605
Коммит c559f3ee21
3 изменённых файлов: 21 добавлений и 21 удалений

Просмотреть файл

@ -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.

Просмотреть файл

@ -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 */

Просмотреть файл

@ -4019,22 +4019,6 @@ SecRule ARGS:route "!<emphasis role="bold">@endsWith %{REQUEST_ADDR}</emphasis>"
role="bold">@inspectFile </emphasis>/opt/apache/bin/inspect_script.pl"</programlisting>
</section>
<section>
<title><literal>is</literal></title>
<para><emphasis role="bold">Description: </emphasis>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.</para>
<para>Example:</para>
<programlisting format="linespecific">SecRule ARGS:foo "!<emphasis
role="bold">@is bar</emphasis>" t:none,deny,status:403
SecRule REQUEST_ADDR "^(.*)$" deny,status:403,capture,chain
SecRule REQUEST_HEADERS:Ip-Address "!<emphasis role="bold">@is %{TX.1}</emphasis>"</programlisting>
</section>
<section>
<title><literal>le</literal></title>
@ -4115,6 +4099,22 @@ SecRule REQUEST_HEADERS:Ip-Address "!<emphasis role="bold">@is %{TX.1}</emphasis
</orderedlist>
</section>
<section>
<title><literal>streq</literal></title>
<para><emphasis role="bold">Description: </emphasis>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.</para>
<para>Example:</para>
<programlisting format="linespecific">SecRule ARGS:foo "!<emphasis
role="bold">@streq bar</emphasis>" t:none,deny,status:403
SecRule REQUEST_ADDR "^(.*)$" deny,status:403,capture,chain
SecRule REQUEST_HEADERS:Ip-Address "!<emphasis role="bold">@streq %{TX.1}</emphasis>"</programlisting>
</section>
<section>
<title><literal>validateByteRange</literal></title>