Skip to content

Commit

Permalink
fix: for when ZIP files dondon't contain directory entries (cashapp#373)
Browse files Browse the repository at this point in the history
  • Loading branch information
alecthomas authored May 3, 2023
1 parent 683e346 commit 0a60ca8
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions archive/archive.go
Original file line number Diff line number Diff line change
Expand Up @@ -421,6 +421,11 @@ func extractZipFile(zf *zip.File, destFile string) error {
return errors.WithStack(os.Symlink(symlinkPath, destFile))
}

err = os.MkdirAll(filepath.Dir(destFile), 0700)
if err != nil {
return errors.WithStack(err)
}

w, err := os.OpenFile(destFile, os.O_CREATE|os.O_WRONLY, zf.Mode()&^0077)
if err != nil {
return errors.WithStack(err)
Expand Down

0 comments on commit 0a60ca8

Please sign in to comment.