From 49e52aa53c644ab432a17cb7d247edb37a84b51a Mon Sep 17 00:00:00 2001 From: liqiang-fit2cloud Date: Fri, 21 Nov 2025 14:58:59 +0800 Subject: [PATCH] refactor: change dir permissions. --- apps/common/utils/tool_code.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/apps/common/utils/tool_code.py b/apps/common/utils/tool_code.py index f5934e5fe..840c11f32 100644 --- a/apps/common/utils/tool_code.py +++ b/apps/common/utils/tool_code.py @@ -48,8 +48,11 @@ class ToolExecutor: return maxkb_logger.debug("init dir") if self.sandbox: - os.chmod("/dev/shm", 0o707) - os.chmod("/dev/mqueue", 0o707) + try: + os.system("chmod -R g-rwx /dev/shm /dev/mqueue") + os.system("chmod o-rwx /run/postgresql") + except: + pass if CONFIG.get("SANDBOX_TMP_DIR_ENABLED", '0') == "1": tmp_dir_path = os.path.join(self.sandbox_path, 'tmp') os.makedirs(tmp_dir_path, 0o700, exist_ok=True)