Skip to content

Commit

Permalink
fix: use openfile to explicitly set magic image perms (#370)
Browse files Browse the repository at this point in the history
(cherry picked from commit 0a11dad)
  • Loading branch information
mafredri authored and johnstcn committed Sep 27, 2024
1 parent 9ee20e7 commit 03def87
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion envbuilder.go
Original file line number Diff line number Diff line change
Expand Up @@ -1596,7 +1596,7 @@ func copyFile(fs billy.Filesystem, src, dst string, mode fs.FileMode) error {
}

func writeMagicImageFile(fs billy.Filesystem, path string, v any) error {
file, err := fs.Create(path)
file, err := fs.OpenFile(path, os.O_CREATE|os.O_WRONLY|os.O_TRUNC, 0o644)
if err != nil {
return fmt.Errorf("create magic image file: %w", err)
}
Expand Down

0 comments on commit 03def87

Please sign in to comment.