Skip to content

Commit 84b503e

Browse files
committed
fix: tighten file permissions for YAML test temp files
- Change temporary file permission mode from 0644 to 0600 when writing invalid YAML test content Signed-off-by: appleboy <[email protected]>
1 parent 14b9c3f commit 84b503e

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

config/config_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ func TestInvalidYAMLFile(t *testing.T) {
2929
content := []byte("invalid: yaml: content: [unclosed")
3030

3131
// Write invalid content to a temporary file
32-
err := os.WriteFile(tmpFile, content, 0o644)
32+
err := os.WriteFile(tmpFile, content, 0o600)
3333
assert.NoError(t, err)
3434
defer os.Remove(tmpFile) // Clean up
3535

0 commit comments

Comments
 (0)