From c58c7d7f3aa5d295d87c0d0991b41eda8d1733ec Mon Sep 17 00:00:00 2001 From: zhengchao Date: Thu, 1 Aug 2019 14:41:28 +0600 Subject: [PATCH] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E5=BC=82=E5=B8=B8=E5=A4=84?= =?UTF-8?q?=E7=90=86region=20compile=E6=97=B6=E5=AF=B9bool=20matcher?= =?UTF-8?q?=E5=88=A4=E7=A9=BA=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/entry/Maat_api.cpp | 10 ++++++++-- src/entry/Maat_command.cpp | 2 +- src/entry/Maat_rule.cpp | 1 + 3 files changed, 10 insertions(+), 3 deletions(-) diff --git a/src/entry/Maat_api.cpp b/src/entry/Maat_api.cpp index 5cf746e..3a96137 100644 --- a/src/entry/Maat_api.cpp +++ b/src/entry/Maat_api.cpp @@ -209,10 +209,16 @@ int region_compile(_Maat_feather_t*feather, struct _INNER_scan_status_t *_mid, c } } - scan_ret=bool_matcher_match(bm, thread_num, + if(bm) + { + scan_ret=bool_matcher_match(bm, thread_num, _mid->all_hit_group_array, _mid->all_hit_group_cnt, (void **)relation_array, MAX_SCANNER_HIT_NUM); - + } + else + { + scan_ret=0; + } if(scan_ret>1) { qsort(relation_array, scan_ret, sizeof(struct Maat_compile_group_relation**), diff --git a/src/entry/Maat_command.cpp b/src/entry/Maat_command.cpp index 5b7bc7f..ebe9417 100644 --- a/src/entry/Maat_command.cpp +++ b/src/entry/Maat_command.cpp @@ -247,7 +247,7 @@ int invalidate_line(char* line, enum MAAT_TABLE_TYPE type,int valid_column_seq) void serialize_group(const struct Maat_group_t* p_group, enum MAAT_OPERATION op, char* buff, size_t sz) { if(op==MAAT_OP_RENEW_TIMEOUT) op=MAAT_OP_ADD; - snprintf(buff, sz, "%d\t%d\t%d\t%d\t%d", p_group->group_id, + snprintf(buff, sz, "%d\t%d\t%d\t%d\t%d\tnull", p_group->group_id, p_group->parent_id, op, p_group->not_flag, diff --git a/src/entry/Maat_rule.cpp b/src/entry/Maat_rule.cpp index b14a545..4fb6d79 100644 --- a/src/entry/Maat_rule.cpp +++ b/src/entry/Maat_rule.cpp @@ -619,6 +619,7 @@ void make_group_set(struct Maat_compile_group_relation* relation, struct bool_ex { continue; } + //high 32 bit is virtual table id, low 32 bit is group id. a_set->items[j].item_id=(unsigned long long)relation->virtual_table_id[j]<<32|group->group_id; a_set->items[j].not_flag=relation->not_flag[j]; if(a_set->items[j].not_flag)