|
func (c overlayWhiteoutConverter) ConvertRead(hdr *tar.Header, path string) (bool, error) { |
|
base := filepath.Base(path) |
|
dir := filepath.Dir(path) |
|
|
|
// if a directory is marked as opaque by the AUFS special file, we need to translate that to overlay |
|
if base == WhiteoutOpaqueDir { |
|
err := unix.Setxattr(dir, "trusted.overlay.opaque", []byte{'y'}, 0) |
|
if err != nil { |
|
if c.inUserNS { |
|
if err = replaceDirWithOverlayOpaque(dir); err != nil { |
|
return false, errors.Wrapf(err, "replaceDirWithOverlayOpaque(%q) failed", dir) |
|
} |
|
} else { |
|
return false, errors.Wrapf(err, "setxattr(%q, trusted.overlay.opaque=y)", dir) |
|
} |
|
} |
|
// don't write the file itself |
|
return false, err |
|
} |
|
|
We should use user.overlay.opaque, not trusted.overlay.opaque when the filesystem is mounted with userxattr option: #42068
moby/pkg/archive/archive_linux.go
Lines 72 to 91 in 46cdcd2
We should use
user.overlay.opaque, nottrusted.overlay.opaquewhen the filesystem is mounted withuserxattroption: #42068