如果扫描无规则table时直接返回,导致未进行非表达式的运算。
This commit is contained in:
@@ -2156,21 +2156,6 @@
|
||||
}
|
||||
],
|
||||
"not_flag" : 0
|
||||
},
|
||||
{
|
||||
"regions": [
|
||||
{
|
||||
"table_name": "KEYWORDS_TABLE",
|
||||
"table_type": "string",
|
||||
"table_content": {
|
||||
"keywords": "contains-keywords-MUST-hit-by-rule-186",
|
||||
"expr_type": "and",
|
||||
"match_method": "expr",
|
||||
"format": "uncase plain"
|
||||
}
|
||||
}
|
||||
],
|
||||
"not_flag" : 0
|
||||
}
|
||||
]
|
||||
}
|
||||
|
||||
@@ -58,4 +58,5 @@
|
||||
35 INTERGER_PLUS intval_plus --
|
||||
36 TEST_FQDN_PLUGIN_WITH_EXDATA fqdn_plugin {"row_id":1,"is_suffix_match":2,"fqdn":3,"valid":5} --
|
||||
37 VIRTUAL_SSL_SNI virtual ["KEYWORDS_TABLE","INTERGER_PLUS"] --
|
||||
38 APP_ID intval --
|
||||
38 APP_ID intval --
|
||||
39 EMPTY_KEYWORD expr UTF8 UTF8 yes 0
|
||||
@@ -1117,12 +1117,12 @@ TEST(NOTLogic, ScanIrrelavantAtLast)
|
||||
TEST(NOTLogic, ScanHitAtLast)
|
||||
{
|
||||
const char* string_should_not_hit="This string should not hit.";
|
||||
const char* string_should_hit="This string contains-keywords-MUST-hit-by-rule-186.";
|
||||
const char* string_match_no_region="This string is matched against a empty table.";
|
||||
int ret=0;
|
||||
int table_id=0;
|
||||
struct Maat_rule_t result[4];
|
||||
int found_pos[4];
|
||||
const char* not_hit_table_name="HTTP_URL", *hit_table_name1="IP_PLUS_CONFIG", *hit_table_name2="KEYWORDS_TABLE";
|
||||
const char* not_hit_table_name="HTTP_URL", *hit_table_name1="IP_PLUS_CONFIG", *empty_table_name="EMPTY_KEYWORD";
|
||||
scan_status_t mid=NULL;
|
||||
table_id=Maat_table_register(g_feather, not_hit_table_name);
|
||||
ASSERT_GT(table_id, 0);
|
||||
@@ -1148,14 +1148,14 @@ TEST(NOTLogic, ScanHitAtLast)
|
||||
|
||||
EXPECT_EQ(ret, -2);
|
||||
|
||||
table_id=Maat_table_register(g_feather, hit_table_name2);
|
||||
table_id=Maat_table_register(g_feather, empty_table_name);
|
||||
ASSERT_GT(table_id, 0);
|
||||
|
||||
Maat_set_scan_status(g_feather, &mid, MAAT_SET_SCAN_LAST_REGION, NULL, 0);
|
||||
|
||||
ret=Maat_full_scan_string(g_feather, table_id, CHARSET_GBK, string_should_hit, strlen(string_should_hit),
|
||||
ret=Maat_full_scan_string(g_feather, table_id, CHARSET_GBK, string_match_no_region, strlen(string_match_no_region),
|
||||
result, found_pos, 4, &mid, 0);
|
||||
|
||||
EXPECT_EQ(ret, 1);
|
||||
EXPECT_EQ(result[0].config_id, 186);
|
||||
Maat_clean_status(&mid);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user