diff --git a/README.md b/README.md index a4fccf92c0cfdcbd8507f282363f1e3b3fa78c05..62c19229178866535f7569b357ac37008a0f233f 100644 --- a/README.md +++ b/README.md @@ -4,6 +4,8 @@ selinux 工具仓, #### 软件架构 + +``` └─log2policy //日志转selinux策略工具 ├─bin //一些python脚本用到的二进制,如cat ├─format_out //格式化以后的selinux策略输出目录,最终输出结果存放在这 @@ -11,3 +13,4 @@ selinux 工具仓, ├─out //中间文件输出目录 ├─sort_out //排序后selinux策略存放目录 └─一键运行.bat //支持一键运行的脚本 +``` diff --git a/log2policy/trans_avc_rule.py b/log2policy/trans_avc_rule.py index 84cf63c9f8c5ae6869ba7ed9870e3d205edbfea7..cde83c4ddaa5a6d96024a0bb8570c51d9cddd87a 100644 --- a/log2policy/trans_avc_rule.py +++ b/log2policy/trans_avc_rule.py @@ -20,7 +20,7 @@ file_title = '# Copyright (c) 2023 Huawei Device Co., Ltd.\n\ # limitations under the License.\n\n' def read_file(path, word, type_hash): - file = open(path, 'r', encoding='UTF-8') + file = open(path, 'r', encoding='UTF-8', errors='ignore') file2 = open("out/tmp.txt", 'w+') file_line = file.readlines() for line in file_line: