fix: set restrictive permissions on config file

This commit is contained in:
0xallam 2026-01-09 21:43:19 -08:00 committed by Ahmed Allam
parent 1cc382249c
commit 5adda5c068

View file

@ -74,8 +74,10 @@ class Config:
def save(cls, config: dict[str, Any]) -> bool:
try:
cls.config_dir().mkdir(parents=True, exist_ok=True)
with cls.config_file().open("w", encoding="utf-8") as f:
config_path = cls.config_file()
with config_path.open("w", encoding="utf-8") as f:
json.dump(config, f, indent=2)
config_path.chmod(0o600)
except OSError:
return False
else: