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)