Skip to content

Commit

Permalink
Merge pull request #1196 from nalind/overlay-whiteout-mode
Browse files Browse the repository at this point in the history
pkg/archive/overlayWhiteoutConverter.ConvertWrite(): force mode to 0
  • Loading branch information
vrothberg committed Apr 12, 2022
2 parents 5d55c44 + cbef82c commit ea4008e
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion pkg/archive/archive_linux.go
Expand Up @@ -36,7 +36,7 @@ func (o overlayWhiteoutConverter) ConvertWrite(hdr *tar.Header, path string, fi
// we just rename the file and make it normal
dir, filename := filepath.Split(hdr.Name)
hdr.Name = filepath.Join(dir, WhiteoutPrefix+filename)
hdr.Mode = 0600
hdr.Mode = 0
hdr.Typeflag = tar.TypeReg
hdr.Size = 0
}
Expand Down
4 changes: 2 additions & 2 deletions pkg/archive/archive_linux_test.go
Expand Up @@ -22,7 +22,7 @@ import (
// ├── d2 # opaque, 0750
// │   └── f1 # empty file, 0660
// └── d3 # 0700
// └── f1 # whiteout, 0644
// └── f1 # whiteout, 0000
func setupOverlayTestDir(t *testing.T, src string) {
// Create opaque directory containing single file and permission 0700
err := os.Mkdir(filepath.Join(src, "d1"), 0700)
Expand Down Expand Up @@ -180,7 +180,7 @@ func TestOverlayTarAUFSUntar(t *testing.T) {
checkFileMode(t, filepath.Join(dst, "d3"), 0700|os.ModeDir)
checkFileMode(t, filepath.Join(dst, "d1", "f1"), 0600)
checkFileMode(t, filepath.Join(dst, "d2", "f1"), 0660)
checkFileMode(t, filepath.Join(dst, "d3", WhiteoutPrefix+"f1"), 0600)
checkFileMode(t, filepath.Join(dst, "d3", WhiteoutPrefix+"f1"), 0)
}

func TestNestedOverlayWhiteouts(t *testing.T) {
Expand Down

0 comments on commit ea4008e

Please sign in to comment.