gsb now saves the base url in tx.1 when match a full url

This commit is contained in:
brenosilva
2011-03-30 17:58:54 +00:00
parent 0c81610818
commit 8642c01344
3 changed files with 30 additions and 14 deletions

View File

@@ -1429,11 +1429,18 @@ static int msre_op_gsbLookup_execute(modsec_rec *msr, msre_rule *rule, msre_var
ret = verify_gsb(gsb, rule, match, match_length);
if(ret > 0) {
set_match_to_tx(msr, capture, match);
set_match_to_tx(msr, capture, match, 0);
if (! *error_msg) {
*error_msg = apr_psprintf(msr->mp, "Gsb lookup for \"%s\" succeeded.",
log_escape_nq(msr->mp, match));
}
str = apr_pstrdup(rule->ruleset->mp,match);
base = apr_strtok(str,"/",&savedptr);
if(base != NULL)
set_match_to_tx(msr, capture, base, 1);
return 1;
}
@@ -1451,11 +1458,18 @@ static int msre_op_gsbLookup_execute(modsec_rec *msr, msre_rule *rule, msre_var
ret = verify_gsb(gsb, rule, canon, canon_length);
if(ret > 0) {
set_match_to_tx(msr, capture, match);
set_match_to_tx(msr, capture, match, 0);
if (! *error_msg) {
*error_msg = apr_psprintf(msr->mp, "Gsb lookup for \"%s\" succeeded.",
log_escape_nq(msr->mp, canon));
}
str = apr_pstrdup(rule->ruleset->mp,match);
base = apr_strtok(str,"/",&savedptr);
if(base != NULL)
set_match_to_tx(msr, capture, base, 1);
return 1;
}
}
@@ -1482,7 +1496,7 @@ static int msre_op_gsbLookup_execute(modsec_rec *msr, msre_rule *rule, msre_var
ret = verify_gsb(gsb, rule, canon, canon_length);
if(ret > 0) {
set_match_to_tx(msr, capture, canon);
set_match_to_tx(msr, capture, canon, 0);
if (! *error_msg) {
*error_msg = apr_psprintf(msr->mp, "Gsb lookup for \"%s\" succeeded.",
log_escape_nq(msr->mp, canon));