fix: set restrictive permissions on config file

This commit is contained in:
0xallam
2026-01-10 15:49:03 -08:00
committed by Ahmed Allam
parent 9ac8ebc001
commit 3f4691aa19
+3 -1
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: