fix: set restrictive permissions on config file
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
@@ -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:
|
||||||
|
|||||||
Reference in New Issue
Block a user