summaryrefslogtreecommitdiff
path: root/tools
diff options
context:
space:
mode:
authorzhengchao <[email protected]>2020-01-13 19:05:24 +0800
committerzhengchao <[email protected]>2020-01-22 20:51:04 +0800
commit94f11e5a7b7a2357cbc605c6687e4934cbe07a5d (patch)
tree83f500ec104f6cf637090378a0f5a066050d52c3 /tools
parentb8df6112af75949263e18307bc3e0dce42411802 (diff)
支持maat json文件加密。
Diffstat (limited to 'tools')
-rw-r--r--tools/maat_redis_tool.cpp10
1 files changed, 8 insertions, 2 deletions
diff --git a/tools/maat_redis_tool.cpp b/tools/maat_redis_tool.cpp
index 58ba87e..584ab3e 100644
--- a/tools/maat_redis_tool.cpp
+++ b/tools/maat_redis_tool.cpp
@@ -1,4 +1,5 @@
#include "Maat_rule.h"
+#include "Maat_utils.h"
#include "Maat_command.h"
#include "Maat_rule_internal.h"
#include "cJSON.h"
@@ -325,8 +326,13 @@ int main(int argc, char * argv[])
read_rule_from_redis(ctx,desired_version,dump_dir, NULL);
}
else if(model==WORK_MODE_JSON)
- {
- ret=json2iris(json_file, NULL, NULL, ctx, tmp_iris_path, sizeof(tmp_iris_path), NULL);
+ {
+ ret=load_file_to_memory(json_file, &json_buff);
+ if(ret<0)
+ {
+ printf("open %s failed.\n", json_file);
+ }
+ ret=json2iris(json_buff, json_file, NULL, NULL, ctx, tmp_iris_path, sizeof(tmp_iris_path), NULL);
if(ret<0)
{
printf("Invalid json format.\n");