From cce2ff448daf4dbb7a3f0726390b7f3fb8352acc Mon Sep 17 00:00:00 2001 From: sunyiming Date: Thu, 1 Feb 2024 09:12:03 +0000 Subject: [PATCH 1/2] chmod to 640 Signed-off-by: sunyiming --- debug/accuracy_tools/api_accuracy_checker/dump/info_dump.py | 1 + 1 file changed, 1 insertion(+) diff --git a/debug/accuracy_tools/api_accuracy_checker/dump/info_dump.py b/debug/accuracy_tools/api_accuracy_checker/dump/info_dump.py index 70d49251f0..c262590437 100644 --- a/debug/accuracy_tools/api_accuracy_checker/dump/info_dump.py +++ b/debug/accuracy_tools/api_accuracy_checker/dump/info_dump.py @@ -39,6 +39,7 @@ def write_json(file_path, data, indent=None): if not os.path.exists(file_path): with FileOpen(file_path, 'w') as f: f.write("{\n}") + os.chmod(file_path, 0o640) lock.acquire() with FileOpen(file_path, 'a+') as f: fcntl.flock(f, fcntl.LOCK_EX) -- Gitee From 62d53acd8c432b44463d3fcc9d9ae2296eb0168a Mon Sep 17 00:00:00 2001 From: sunyiming Date: Thu, 1 Feb 2024 09:21:45 +0000 Subject: [PATCH 2/2] update debug/accuracy_tools/api_accuracy_checker/dump/info_dump.py. Signed-off-by: sunyiming --- debug/accuracy_tools/api_accuracy_checker/dump/info_dump.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/debug/accuracy_tools/api_accuracy_checker/dump/info_dump.py b/debug/accuracy_tools/api_accuracy_checker/dump/info_dump.py index c262590437..5fc19ccc3e 100644 --- a/debug/accuracy_tools/api_accuracy_checker/dump/info_dump.py +++ b/debug/accuracy_tools/api_accuracy_checker/dump/info_dump.py @@ -9,7 +9,7 @@ from ptdbg_ascend.src.python.ptdbg_ascend.common.utils import check_path_before_ from api_accuracy_checker.common.config import msCheckerConfig -from ptdbg_ascend.src.python.ptdbg_ascend.common.file_check_util import FileOpen, FileCheckConst, FileChecker +from ptdbg_ascend.src.python.ptdbg_ascend.common.file_check_util import FileOpen, FileCheckConst, FileChecker, change_mode lock = threading.Lock() @@ -39,7 +39,7 @@ def write_json(file_path, data, indent=None): if not os.path.exists(file_path): with FileOpen(file_path, 'w') as f: f.write("{\n}") - os.chmod(file_path, 0o640) + change_mode(file_path, FileCheckConst.DATA_FILE_AUTHORITY) lock.acquire() with FileOpen(file_path, 'a+') as f: fcntl.flock(f, fcntl.LOCK_EX) -- Gitee