summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorliuwentan <[email protected]>2023-04-03 15:14:57 +0800
committerliuwentan <[email protected]>2023-04-03 15:14:57 +0800
commit3ed1f3dfd4c31c60859afb146f69e0284dec5890 (patch)
treec170f080917e9f171eab30b849cdde07661250a1
parent5873d77f1764681f8fbed00938c656ff27de8446 (diff)
delete compile table evaluation_order schemav4.0.2
-rw-r--r--src/maat_compile.c20
-rw-r--r--test/maat_framework_gtest.cpp4
-rw-r--r--test/table_info.conf6
3 files changed, 4 insertions, 26 deletions
diff --git a/src/maat_compile.c b/src/maat_compile.c
index b797e25..bffa515 100644
--- a/src/maat_compile.c
+++ b/src/maat_compile.c
@@ -31,7 +31,6 @@ struct compile_schema {
int compile_id_column;
int rule_tag_column;
int declared_clause_num_column;
- int evaluation_order_column;
struct ex_data_schema *ex_schema;
int table_id; //ugly
char table_name[NAME_MAX];
@@ -291,15 +290,6 @@ void *compile_schema_new(cJSON *json, struct table_manager *tbl_mgr,
goto error;
}
- custom_item = cJSON_GetObjectItem(item, "evaluation_order");
- if (custom_item != NULL && custom_item->type == cJSON_Number) {
- compile_schema->evaluation_order_column = custom_item->valueint;
- } else {
- log_error(logger, MODULE_COMPILE,
- "[%s:%d] table %s has no evaluation_order column", table_name);
- goto error;
- }
-
compile_schema->ref_tbl_mgr = tbl_mgr;
return compile_schema;
error:
@@ -489,16 +479,6 @@ compile_item_new(const char *line, struct compile_schema *compile_schema,
}
compile_item->declared_clause_num = atoi(line + column_offset);
- ret = get_column_pos(line, compile_schema->evaluation_order_column,
- &column_offset, &column_len);
- if (ret < 0) {
- log_error(logger, MODULE_COMPILE,
- "[%s:%d] compile table(table_id:%d) line:%s has no evaluation_order",
- __FUNCTION__, __LINE__, compile_schema->table_id, line);
- goto error;
- }
- compile_item->evaluation_order = atof(line + column_offset);
-
return compile_item;
error:
FREE(compile_item);
diff --git a/test/maat_framework_gtest.cpp b/test/maat_framework_gtest.cpp
index 7cbdc85..073e0c4 100644
--- a/test/maat_framework_gtest.cpp
+++ b/test/maat_framework_gtest.cpp
@@ -2827,9 +2827,9 @@ TEST_F(Policy, EvaluationOrder) {
results, ARRAY_SIZE, &n_hit_result, state);
EXPECT_EQ(ret, MAAT_SCAN_HIT);
EXPECT_EQ(n_hit_result, 3);
- EXPECT_EQ(results[0], 166);
+ EXPECT_EQ(results[0], 168);
EXPECT_EQ(results[1], 167);
- EXPECT_EQ(results[2], 168);
+ EXPECT_EQ(results[2], 166);
uint32_t ip_addr;
inet_pton(AF_INET, "192.168.23.23", &ip_addr);
diff --git a/test/table_info.conf b/test/table_info.conf
index 44eeae2..9b6764f 100644
--- a/test/table_info.conf
+++ b/test/table_info.conf
@@ -8,8 +8,7 @@
"custom": {
"compile_id":1,
"tags":6,
- "clause_num":9,
- "evaluation_order":10
+ "clause_num":9
}
},
{
@@ -35,8 +34,7 @@
"custom": {
"compile_id":1,
"tags":6,
- "clause_num":9,
- "evaluation_order":10
+ "clause_num":9
}
},
{