mirror of
https://github.com/containers/podman.git
synced 2025-12-09 23:27:09 +08:00
Update vendor of containers/buildah
Changes since 2022-05-31: - add --omit-history option (buildah PR 4028) Signed-off-by: Ed Santiago <santiago@redhat.com> Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
This commit is contained in:
30
vendor/github.com/containers/storage/pkg/archive/archive.go
generated
vendored
30
vendor/github.com/containers/storage/pkg/archive/archive.go
generated
vendored
@@ -12,6 +12,7 @@ import (
|
||||
"os"
|
||||
"path/filepath"
|
||||
"runtime"
|
||||
"strconv"
|
||||
"strings"
|
||||
"sync"
|
||||
"syscall"
|
||||
@@ -72,10 +73,10 @@ type (
|
||||
)
|
||||
|
||||
const (
|
||||
tarExt = "tar"
|
||||
solaris = "solaris"
|
||||
windows = "windows"
|
||||
containersOverrideXattr = "user.containers.override_stat"
|
||||
tarExt = "tar"
|
||||
solaris = "solaris"
|
||||
windows = "windows"
|
||||
darwin = "darwin"
|
||||
)
|
||||
|
||||
var xattrsToIgnore = map[string]interface{}{
|
||||
@@ -698,9 +699,9 @@ func createTarFile(path, extractDir string, hdr *tar.Header, reader io.Reader, L
|
||||
return fmt.Errorf("unhandled tar header type %d", hdr.Typeflag)
|
||||
}
|
||||
|
||||
if forceMask != nil && hdr.Typeflag != tar.TypeSymlink {
|
||||
if forceMask != nil && (hdr.Typeflag != tar.TypeSymlink || runtime.GOOS == "darwin") {
|
||||
value := fmt.Sprintf("%d:%d:0%o", hdr.Uid, hdr.Gid, hdrInfo.Mode()&07777)
|
||||
if err := system.Lsetxattr(path, containersOverrideXattr, []byte(value), 0); err != nil {
|
||||
if err := system.Lsetxattr(path, idtools.ContainersOverrideXattr, []byte(value), 0); err != nil {
|
||||
return err
|
||||
}
|
||||
}
|
||||
@@ -981,7 +982,7 @@ func Unpack(decompressedArchive io.Reader, dest string, options *TarOptions) err
|
||||
uid, gid, mode, err := GetFileOwner(dest)
|
||||
if err == nil {
|
||||
value := fmt.Sprintf("%d:%d:0%o", uid, gid, mode)
|
||||
if err := system.Lsetxattr(dest, containersOverrideXattr, []byte(value), 0); err != nil {
|
||||
if err := system.Lsetxattr(dest, idtools.ContainersOverrideXattr, []byte(value), 0); err != nil {
|
||||
return err
|
||||
}
|
||||
}
|
||||
@@ -1313,6 +1314,21 @@ func remapIDs(readIDMappings, writeIDMappings *idtools.IDMappings, chownOpts *id
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
} else if runtime.GOOS == darwin {
|
||||
uid, gid = hdr.Uid, hdr.Gid
|
||||
if xstat, ok := hdr.Xattrs[idtools.ContainersOverrideXattr]; ok {
|
||||
attrs := strings.Split(string(xstat), ":")
|
||||
if len(attrs) == 3 {
|
||||
val, err := strconv.ParseUint(attrs[0], 10, 32)
|
||||
if err != nil {
|
||||
uid = int(val)
|
||||
}
|
||||
val, err = strconv.ParseUint(attrs[1], 10, 32)
|
||||
if err != nil {
|
||||
gid = int(val)
|
||||
}
|
||||
}
|
||||
}
|
||||
} else {
|
||||
uid, gid = hdr.Uid, hdr.Gid
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user