Preserve permissions when extracting zip files
@@ -956,7 +956,7 @@ func Unzip(src, dest, pathToUnzip string) ([]string, error) {
return filenames, err
}
- outFile, err := os.OpenFile(fpath, os.O_WRONLY|os.O_CREATE|os.O_TRUNC, ModeReadWriteFile)
+ outFile, err := os.OpenFile(fpath, os.O_WRONLY|os.O_CREATE|os.O_TRUNC, f.Mode())
if err != nil {
return filenames, err
}
