mirror of
https://github.com/charmbracelet/crush.git
synced 2025-08-02 05:20:46 +03:00
Use default permissions of 0600 for crush.json to help protect sensitive
data that is stored in plain text (api keys, etc.) Fixes #411
This commit is contained in:
committed by
Kujtim Hoxha
parent
3b8a8ef95c
commit
c99034909d
@@ -371,7 +371,7 @@ func (c *Config) SetConfigField(key string, value any) error {
|
||||
if err != nil {
|
||||
return fmt.Errorf("failed to set config field %s: %w", key, err)
|
||||
}
|
||||
if err := os.WriteFile(c.dataConfigDir, []byte(newValue), 0o644); err != nil {
|
||||
if err := os.WriteFile(c.dataConfigDir, []byte(newValue), 0o600); err != nil {
|
||||
return fmt.Errorf("failed to write config file: %w", err)
|
||||
}
|
||||
return nil
|
||||
|
||||
Reference in New Issue
Block a user