aboutsummaryrefslogtreecommitdiff
path: root/internal/crud
diff options
context:
space:
mode:
authorishaan <contact@ishaan.cc>2026-07-15 07:23:47 +0530
committerishaan <contact@ishaan.cc>2026-07-15 07:23:47 +0530
commit8ebc072fb0ceae229196e8d3d8ff15bbbc049fdd (patch)
tree922ae6355ec6806dc5366a55582038b7b90cf76d /internal/crud
parent4c64c1f923d2e1b8b5925b0d2d7f7fbd7b38e6a2 (diff)
better encrypted/decrypted file perms
Diffstat (limited to 'internal/crud')
-rw-r--r--internal/crud/cli_new.go8
1 files changed, 4 insertions, 4 deletions
diff --git a/internal/crud/cli_new.go b/internal/crud/cli_new.go
index dfd32ad..a7408d7 100644
--- a/internal/crud/cli_new.go
+++ b/internal/crud/cli_new.go
@@ -42,7 +42,7 @@ func NewNotePass(output string) error {
}
fmt.Println(output)
- file, err := os.Create(output)
+ file, err := os.OpenFile(output, os.O_RDWR|os.O_CREATE|os.O_TRUNC, 0600)
if err != nil {
return err
}
@@ -90,7 +90,7 @@ func NewNotePassEdit(output, editorString string) error {
return err
}
- file, err := os.Create(output)
+ file, err := os.OpenFile(output, os.O_RDWR|os.O_CREATE|os.O_TRUNC, 0600)
if err != nil {
return err
}
@@ -244,7 +244,7 @@ func NewNoteSSH(output string, defaultPubKeyBytes []byte) error {
}
fmt.Println(output)
- file, err := os.Create(output)
+ file, err := os.OpenFile(output, os.O_RDWR|os.O_CREATE|os.O_TRUNC, 0600)
if err != nil {
return err
}
@@ -282,7 +282,7 @@ func NewNoteSSHEdit(output string, defaultPubKeyBytes []byte, defaultPrivKeyPath
crypt.TryMlock(noteKey)
defer clear(noteKey)
- file, err := os.Create(output)
+ file, err := os.OpenFile(output, os.O_RDWR|os.O_CREATE|os.O_TRUNC, 0600)
if err != nil {
return err
}