diff --git a/pkg/fsutil/file.go b/pkg/fsutil/file.go index 918c45d89..0c0eb5271 100644 --- a/pkg/fsutil/file.go +++ b/pkg/fsutil/file.go @@ -20,7 +20,7 @@ func CopyFile(srcpath, dstpath string) (err error) { return err } - w, err := os.OpenFile(dstpath, os.O_CREATE|os.O_EXCL, 0666) + w, err := os.OpenFile(dstpath, os.O_CREATE|os.O_WRONLY|os.O_EXCL, 0666) if err != nil { r.Close() // We need to close the input file as the defer below would not be called. return err