diff options
| author | ishaan <contact@ishaan.cc> | 2026-07-15 07:23:47 +0530 |
|---|---|---|
| committer | ishaan <contact@ishaan.cc> | 2026-07-15 07:23:47 +0530 |
| commit | 8ebc072fb0ceae229196e8d3d8ff15bbbc049fdd (patch) | |
| tree | 922ae6355ec6806dc5366a55582038b7b90cf76d /cmd/eno/config.go | |
| parent | 4c64c1f923d2e1b8b5925b0d2d7f7fbd7b38e6a2 (diff) | |
better encrypted/decrypted file perms
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 } |