Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions pkg/diff/diff.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import (
"os"
"path"
"path/filepath"
"runtime"
"slices"
"sort"
"strconv"
Expand Down Expand Up @@ -700,6 +701,21 @@ func (d *differ) loadLayer(ctx context.Context, node *EventTreeNode, inputIdx in
hdr.Name = strings.TrimPrefix(hdr.Name, "/")
hdr.Name = strings.TrimPrefix(hdr.Name, "./")
}
if os.Geteuid() != 0 && runtime.GOOS == "linux" {
//nolint:staticcheck // SA1019: hdr.Xattrs has been deprecated since Go 1.10: Use PAXRecords instead.
for k := range hdr.Xattrs {
if strings.HasPrefix(k, "security.") {
log.G(ctx).Debugf("Ignoring xattr %q", k)
delete(hdr.Xattrs, k)
}
}
for k := range hdr.PAXRecords {
if strings.HasPrefix(k, "SCHILY.xattr.security.") {
log.G(ctx).Debugf("Ignoring PAX record %q", k)
delete(hdr.PAXRecords, k)
}
}
}
res.entries++
ent := &TarEntry{
Index: i,
Expand Down