From f45814d0b75aa00a7a833ed878ffcf085376f0db Mon Sep 17 00:00:00 2001 From: zhengchao Date: Sat, 5 Dec 2020 13:50:03 +0600 Subject: 修复Maat_hierarchy_region_compile中对compile->literal_ids的线程不安全访问,在配置更新时可导致段错误。 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/entry/Maat_hierarchy.cpp | 2 +- src/entry/Maat_rule.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/entry/Maat_hierarchy.cpp b/src/entry/Maat_hierarchy.cpp index 7cb33cc..ee2227e 100644 --- a/src/entry/Maat_hierarchy.cpp +++ b/src/entry/Maat_hierarchy.cpp @@ -923,10 +923,10 @@ int Maat_hierarchy_rebuild(struct Maat_hierarchy* hier) { int ret=0; struct bool_matcher* new_bm=NULL, *old_bm=NULL; + pthread_rwlock_wrlock(&hier->rwlock); new_bm=Maat_hierarchy_build_bool_matcher(hier); old_bm=hier->bm; - pthread_rwlock_wrlock(&hier->rwlock); hier->bm=new_bm; pthread_rwlock_unlock(&hier->rwlock); diff --git a/src/entry/Maat_rule.cpp b/src/entry/Maat_rule.cpp index d40cf64..af3b034 100644 --- a/src/entry/Maat_rule.cpp +++ b/src/entry/Maat_rule.cpp @@ -56,7 +56,7 @@ extern "C" } #endif -int MAAT_FRAME_VERSION_3_1_4_20201124=1; +int MAAT_FRAME_VERSION_3_1_4_20201205=1; int is_valid_table_name(const char* str) { -- cgit v1.2.3