refactor: change dir permissions.

This commit is contained in:
liqiang-fit2cloud 2025-11-21 14:58:59 +08:00
parent e27d39c1ac
commit 49e52aa53c

View File

@ -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)