Merge branch 'main' of https://github.com/steveyegge/beads
This commit is contained in:
@@ -31,8 +31,8 @@ func atomicWriteFile(path string, data []byte) error {
|
||||
return fmt.Errorf("close temp file: %w", err)
|
||||
}
|
||||
|
||||
// Set permissions to 0644
|
||||
if err := os.Chmod(tmpPath, 0644); err != nil {
|
||||
// Set permissions to 0600 (owner read/write only)
|
||||
if err := os.Chmod(tmpPath, 0600); err != nil {
|
||||
_ = os.Remove(tmpPath) // Best effort cleanup
|
||||
return fmt.Errorf("set permissions: %w", err)
|
||||
}
|
||||
|
||||
@@ -35,8 +35,8 @@ func TestAtomicWriteFile(t *testing.T) {
|
||||
}
|
||||
|
||||
mode := info.Mode()
|
||||
if mode.Perm() != 0644 {
|
||||
t.Errorf("file permissions mismatch: got %o, want %o", mode.Perm(), 0644)
|
||||
if mode.Perm() != 0600 {
|
||||
t.Errorf("file permissions mismatch: got %o, want %o", mode.Perm(), 0600)
|
||||
}
|
||||
|
||||
// Test overwriting existing file
|
||||
|
||||
Reference in New Issue
Block a user