diff --git a/go.mod b/go.mod index 43b6e1aa7e5f..07412def2e2b 100644 --- a/go.mod +++ b/go.mod @@ -73,7 +73,7 @@ require ( github.com/spdx/tools-golang v0.5.3 github.com/stretchr/testify v1.10.0 github.com/tonistiigi/dchapes-mode v0.0.0-20250318174251-73d941a28323 - github.com/tonistiigi/fsutil v0.0.0-20250410151801-5b74a7ad7583 + github.com/tonistiigi/fsutil v0.0.0-20250417144416-3f76f8130144 github.com/tonistiigi/go-actions-cache v0.0.0-20250228231703-3e9a6642607f github.com/tonistiigi/go-archvariant v1.0.0 github.com/tonistiigi/go-csvvalue v0.0.0-20240710180619-ddb21b71c0b4 diff --git a/go.sum b/go.sum index 289751e89174..db25489f939c 100644 --- a/go.sum +++ b/go.sum @@ -397,8 +397,8 @@ github.com/syndtr/gocapability v0.0.0-20200815063812-42c35b437635 h1:kdXcSzyDtse github.com/syndtr/gocapability v0.0.0-20200815063812-42c35b437635/go.mod h1:hkRG7XYTFWNJGYcbNJQlaLq0fg1yr4J4t/NcTQtrfww= github.com/tonistiigi/dchapes-mode v0.0.0-20250318174251-73d941a28323 h1:r0p7fK56l8WPequOaR3i9LBqfPtEdXIQbUTzT55iqT4= github.com/tonistiigi/dchapes-mode v0.0.0-20250318174251-73d941a28323/go.mod h1:3Iuxbr0P7D3zUzBMAZB+ois3h/et0shEz0qApgHYGpY= -github.com/tonistiigi/fsutil v0.0.0-20250410151801-5b74a7ad7583 h1:mK+ZskNt7SG4dxfKIi27C7qHAQzyjAVt1iyTf0hmsNc= -github.com/tonistiigi/fsutil v0.0.0-20250410151801-5b74a7ad7583/go.mod h1:BKdcez7BiVtBvIcef90ZPc6ebqIWr4JWD7+EvLm6J98= +github.com/tonistiigi/fsutil v0.0.0-20250417144416-3f76f8130144 h1:k9tdF32oJYwtjzMx+D26M6eYiCaAPdJ7tyN7tF1oU5Q= +github.com/tonistiigi/fsutil v0.0.0-20250417144416-3f76f8130144/go.mod h1:BKdcez7BiVtBvIcef90ZPc6ebqIWr4JWD7+EvLm6J98= github.com/tonistiigi/go-actions-cache v0.0.0-20250228231703-3e9a6642607f h1:q/SWz3Bz0KtAsqaBo73CHVXjaz5O8PDnmD2JHVhgYnE= github.com/tonistiigi/go-actions-cache v0.0.0-20250228231703-3e9a6642607f/go.mod h1:h0oRlVs3NoFIHysRQ4rU1+RG4QmU0M2JVSwTYrB4igk= github.com/tonistiigi/go-archvariant v1.0.0 h1:5LC1eDWiBNflnTF1prCiX09yfNHIxDC/aukdhCdTyb0= diff --git a/vendor/github.com/tonistiigi/fsutil/stat_unix.go b/vendor/github.com/tonistiigi/fsutil/stat_unix.go index def901e31289..94e5da0f9bbe 100644 --- a/vendor/github.com/tonistiigi/fsutil/stat_unix.go +++ b/vendor/github.com/tonistiigi/fsutil/stat_unix.go @@ -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) diff --git a/vendor/modules.txt b/vendor/modules.txt index cc1bd9d17338..0e1168898505 100644 --- a/vendor/modules.txt +++ b/vendor/modules.txt @@ -781,7 +781,7 @@ github.com/syndtr/gocapability/capability # github.com/tonistiigi/dchapes-mode v0.0.0-20250318174251-73d941a28323 ## explicit; go 1.21 github.com/tonistiigi/dchapes-mode -# github.com/tonistiigi/fsutil v0.0.0-20250410151801-5b74a7ad7583 +# github.com/tonistiigi/fsutil v0.0.0-20250417144416-3f76f8130144 ## explicit; go 1.21 github.com/tonistiigi/fsutil github.com/tonistiigi/fsutil/copy