Skip to content

Commit 3b4ea67

Browse files
committed
Ensure the folders have the proper permissions
1 parent 5e532d2 commit 3b4ea67

2 files changed

Lines changed: 3 additions & 2 deletions

File tree

extract.go

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -175,7 +175,7 @@ func Zip(body io.Reader, location string, rename Renamer) error {
175175

176176
switch {
177177
case info.IsDir():
178-
if err := os.MkdirAll(path, info.Mode()); err != nil {
178+
if err := os.MkdirAll(path, info.Mode()|os.ModeDir|100); err != nil {
179179
return errors.Annotatef(err, "Create directory %s", path)
180180
}
181181
// We only check for symlinks because hard links aren't possible
@@ -219,7 +219,8 @@ func Zip(body io.Reader, location string, rename Renamer) error {
219219
}
220220

221221
func copy(path string, mode os.FileMode, src io.Reader) error {
222-
err := os.MkdirAll(filepath.Dir(path), mode|os.ModeDir)
222+
// We add the execution permission to be able to create files inside it
223+
err := os.MkdirAll(filepath.Dir(path), mode|os.ModeDir|100)
223224
if err != nil {
224225
return err
225226
}

testdata/archive.zip

0 Bytes
Binary file not shown.

0 commit comments

Comments
 (0)