diff options
Diffstat (limited to 'cmd/eno/config.go')
| -rw-r--r-- | cmd/eno/config.go | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/cmd/eno/config.go b/cmd/eno/config.go index 6725e84..90bdf1b 100644 --- a/cmd/eno/config.go +++ b/cmd/eno/config.go @@ -109,7 +109,7 @@ func handlerInit() error { if err := os.MkdirAll(filepath.Dir(Conf.ConfPath), 0755); err != nil { return fmt.Errorf("creating config dir: %w", err) } - f, err := os.Create(Conf.ConfPath) + f, err := os.OpenFile(Conf.ConfPath, os.O_RDWR|os.O_CREATE|os.O_TRUNC, 0600) if err != nil { return fmt.Errorf("creating config file: %w", err) } @@ -187,7 +187,7 @@ func updateConfig(key string, val any) error { lines = append(lines, newLine) } - err = os.WriteFile(Conf.ConfPath, []byte(strings.Join(lines, "\n")), 0644) + err = os.WriteFile(Conf.ConfPath, []byte(strings.Join(lines, "\n")), 0600) if err != nil { return err } |