Skip to content
Open
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
6 changes: 4 additions & 2 deletions fs/diff_unix.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,13 @@ package fs

import (
"bytes"
"errors"
"fmt"
"os"
"syscall"

"github.com/containerd/continuity/sysx"
"golang.org/x/sys/unix"
)

// compareSysStat returns whether the stats are equivalent,
Expand All @@ -45,11 +47,11 @@ func compareSysStat(s1, s2 interface{}) (bool, error) {

func compareCapabilities(p1, p2 string) (bool, error) {
c1, err := sysx.LGetxattr(p1, "security.capability")
if err != nil && err != sysx.ENODATA {
if err != nil && !errors.Is(err, unix.ENOTSUP) && !errors.Is(err, sysx.ENODATA) {
return false, fmt.Errorf("failed to get xattr for %s: %w", p1, err)
}
c2, err := sysx.LGetxattr(p2, "security.capability")
if err != nil && err != sysx.ENODATA {
if err != nil && !errors.Is(err, unix.ENOTSUP) && !errors.Is(err, sysx.ENODATA) {
return false, fmt.Errorf("failed to get xattr for %s: %w", p2, err)
}
return bytes.Equal(c1, c2), nil
Expand Down
Loading