fix: set restrictive permissions on config file

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
0xallam
2026-01-09 21:43:19 -08:00
committed by Ahmed Allam
parent 13e804b7e3
commit fe456d57fe

View File

@@ -74,8 +74,10 @@ class Config:
def save(cls, config: dict[str, Any]) -> bool: def save(cls, config: dict[str, Any]) -> bool:
try: try:
cls.config_dir().mkdir(parents=True, exist_ok=True) 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) json.dump(config, f, indent=2)
config_path.chmod(0o600)
except OSError: except OSError:
return False return False
else: else: