From 608a50535c2d67fd9248acb743d241c27605b680 Mon Sep 17 00:00:00 2001 From: zhengchao Date: Mon, 27 Jul 2020 20:53:48 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E4=BB=8Eredis=E4=B8=AD?= =?UTF-8?q?=E5=8A=A0=E8=BD=BDip=5Fplugin=E8=A1=A8=E6=97=B6=EF=BC=8C?= =?UTF-8?q?=E6=9C=AA=E8=83=BD=E6=AD=A3=E7=A1=AE=E8=AF=BB=E5=8F=96=E6=9C=89?= =?UTF-8?q?=E6=95=88=E6=A0=87=E5=BF=97=E4=BD=8D=E7=9A=84bug=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/entry/Maat_command.cpp | 16 +++++++++++----- src/entry/Maat_rule.cpp | 2 +- 2 files changed, 12 insertions(+), 6 deletions(-) diff --git a/src/entry/Maat_command.cpp b/src/entry/Maat_command.cpp index 35873a5..645df1c 100644 --- a/src/entry/Maat_command.cpp +++ b/src/entry/Maat_command.cpp @@ -193,6 +193,7 @@ int get_valid_flag_offset(const char* line, enum MAAT_TABLE_TYPE type,int valid_ column_seq=8; break; case TABLE_TYPE_PLUGIN: + case TABLE_TYPE_IP_PLUGIN: if(valid_column_seq<0) { return -1; @@ -1614,7 +1615,6 @@ void redis_monitor_traverse(long long version, struct source_redis_ctx* m long long new_version=0; enum MAAT_TABLE_TYPE table_type; struct Maat_table_schema* table_desc=NULL; - const struct plugin_table_schema* plugin_desc=NULL; void* logger=feather->logger; if(mr_ctx->write_ctx!=NULL&&mr_ctx->write_ctx->err==0)//authorized to write @@ -1703,11 +1703,17 @@ void redis_monitor_traverse(long long version, struct source_redis_ctx* m table_type=Maat_table_get_type_by_id(feather->table_mgr, table_id); if(rule_list[i].op==MAAT_OP_DEL) { - if(table_type==TABLE_TYPE_PLUGIN) + if(table_type==TABLE_TYPE_PLUGIN||table_type==TABLE_TYPE_IP_PLUGIN) { - table_desc=Maat_table_get_scan_by_id(feather->table_mgr, table_id, TABLE_TYPE_PLUGIN, NULL); - plugin_desc=&(table_desc->plugin); - valid_column=plugin_desc->valid_flag_column; + table_desc=Maat_table_get_scan_by_id(feather->table_mgr, table_id, table_type, NULL); + if(table_type==TABLE_TYPE_PLUGIN) + { + valid_column=table_desc->plugin.valid_flag_column; + } + else + { + valid_column=table_desc->ip_plugin.valid_flag_column; + } } else { diff --git a/src/entry/Maat_rule.cpp b/src/entry/Maat_rule.cpp index fa48af8..6d829a3 100644 --- a/src/entry/Maat_rule.cpp +++ b/src/entry/Maat_rule.cpp @@ -34,7 +34,7 @@ #include "stream_fuzzy_hash.h" #include "gram_index_engine.h" -int MAAT_FRAME_VERSION_3_0_20200707=1; +int MAAT_FRAME_VERSION_3_0_20200724=1; int is_valid_table_name(const char* str) {