vendor: github.com/moby/buildkit v0.22.0-rc1
Signed-off-by: CrazyMax <1951866+crazy-max@users.noreply.github.com>
This commit is contained in:
+19
-3
@@ -5,6 +5,7 @@ package fsutil
|
||||
|
||||
import (
|
||||
"os"
|
||||
"strings"
|
||||
"syscall"
|
||||
|
||||
"github.com/containerd/continuity/sysx"
|
||||
@@ -12,6 +13,8 @@ import (
|
||||
"github.com/tonistiigi/fsutil/types"
|
||||
)
|
||||
|
||||
const xattrApplePrefix = "com.apple."
|
||||
|
||||
func loadXattr(origpath string, stat *types.Stat) error {
|
||||
xattrs, err := sysx.LListxattr(origpath)
|
||||
if err != nil {
|
||||
@@ -23,16 +26,29 @@ func loadXattr(origpath string, stat *types.Stat) error {
|
||||
if len(xattrs) > 0 {
|
||||
m := make(map[string][]byte)
|
||||
for _, key := range xattrs {
|
||||
v, err := sysx.LGetxattr(origpath, key)
|
||||
if err == nil {
|
||||
if skipXattr(key) {
|
||||
continue
|
||||
}
|
||||
|
||||
if v, err := sysx.LGetxattr(origpath, key); err == nil {
|
||||
m[key] = v
|
||||
}
|
||||
}
|
||||
stat.Xattrs = m
|
||||
|
||||
if len(m) > 0 {
|
||||
stat.Xattrs = m
|
||||
}
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func skipXattr(key string) bool {
|
||||
if strings.HasPrefix(key, xattrApplePrefix) {
|
||||
return true
|
||||
}
|
||||
return false
|
||||
}
|
||||
|
||||
func setUnixOpt(fi os.FileInfo, stat *types.Stat, path string, seenFiles map[uint64]string) {
|
||||
s := fi.Sys().(*syscall.Stat_t)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user