Skip to content

Commit

Permalink
Merge pull request #288 from securesign/truncate_repo
Browse files Browse the repository at this point in the history
Truncate files if they exist prior to extraction from archive (sigstore#1245)
  • Loading branch information
bouskaJ authored Aug 30, 2024
2 parents 2656f8c + 3b3b255 commit a28d63d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion pkg/repo/repo.go
Original file line number Diff line number Diff line change
Expand Up @@ -270,7 +270,7 @@ func Uncompress(src io.Reader, dst string) error {
}
// Write out files
case tar.TypeReg:
fileToWrite, err := os.OpenFile(target, os.O_CREATE|os.O_RDWR, os.FileMode(header.Mode))
fileToWrite, err := os.OpenFile(target, os.O_CREATE|os.O_RDWR|os.O_TRUNC, os.FileMode(header.Mode))
if err != nil {
return err
}
Expand Down

0 comments on commit a28d63d

Please sign in to comment.