"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "pkg/archive/archive.go" between
moby-20.10.6.tar.gz and moby-20.10.7.tar.gz

About: Moby is a framework to assemble specialized container systems (formerly project name Docker; see here to clarify the relationship between the projects).

archive.go  (moby-20.10.6):archive.go  (moby-20.10.7)
skipping to change at line 405 skipping to change at line 405
mode |= modeISFIFO mode |= modeISFIFO
case fm&os.ModeSocket != 0: case fm&os.ModeSocket != 0:
mode |= modeISSOCK mode |= modeISSOCK
} }
return mode return mode
} }
// ReadSecurityXattrToTarHeader reads security.capability xattr from filesystem // ReadSecurityXattrToTarHeader reads security.capability xattr from filesystem
// to a tar header // to a tar header
func ReadSecurityXattrToTarHeader(path string, hdr *tar.Header) error { func ReadSecurityXattrToTarHeader(path string, hdr *tar.Header) error {
const (
// Values based on linux/include/uapi/linux/capability.h
xattrCapsSz2 = 20
versionOffset = 3
vfsCapRevision2 = 2
vfsCapRevision3 = 3
)
capability, _ := system.Lgetxattr(path, "security.capability") capability, _ := system.Lgetxattr(path, "security.capability")
if capability != nil { if capability != nil {
length := len(capability)
if capability[versionOffset] == vfsCapRevision3 {
// Convert VFS_CAP_REVISION_3 to VFS_CAP_REVISION_2 as ro
ot UID makes no
// sense outside the user namespace the archive is built
in.
capability[versionOffset] = vfsCapRevision2
length = xattrCapsSz2
}
hdr.Xattrs = make(map[string]string) hdr.Xattrs = make(map[string]string)
hdr.Xattrs["security.capability"] = string(capability) hdr.Xattrs["security.capability"] = string(capability[:length])
} }
return nil return nil
} }
type tarWhiteoutConverter interface { type tarWhiteoutConverter interface {
ConvertWrite(*tar.Header, string, os.FileInfo) (*tar.Header, error) ConvertWrite(*tar.Header, string, os.FileInfo) (*tar.Header, error)
ConvertRead(*tar.Header, string) (bool, error) ConvertRead(*tar.Header, string) (bool, error)
} }
type tarAppender struct { type tarAppender struct {
 End of changes. 3 change blocks. 
1 lines changed or deleted 17 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)