Skip to content
This repository was archived by the owner on Mar 27, 2024. It is now read-only.

Commit 3d6d468

Browse files
authored
Merge pull request #155 from nkubala/umask
Drop umask to 0 when writing files to disk
2 parents 4999569 + d1d305e commit 3d6d468

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

pkg/util/tar_utils.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,11 @@ func unpackTar(tr *tar.Reader, path string) error {
8080
logrus.Errorf("Error opening file %s", target)
8181
return err
8282
}
83+
// manually set permissions on file, since the default umask (022) will interfere
84+
if err = os.Chmod(target, mode); err != nil {
85+
logrus.Errorf("Error updating file permissions on %s", target)
86+
return err
87+
}
8388
_, err = io.Copy(currFile, tr)
8489
if err != nil {
8590
return err

0 commit comments

Comments
 (0)