fix: ignore lgetxattr on EBADF

This commit is contained in:
Lionello Lunesu 2024-08-15 15:31:12 -07:00
parent e328007bc1
commit e43ce74338
1 changed files with 1 additions and 1 deletions

View File

@ -169,7 +169,7 @@ func readSecurityXattrToTarHeader(path string, hdr *tar.Header) error {
hdr.Xattrs = make(map[string]string)
}
capability, err := system.Lgetxattr(path, securityCapabilityXattr)
if err != nil && !errors.Is(err, syscall.EOPNOTSUPP) && !errors.Is(err, system.ErrNotSupportedPlatform) {
if err != nil && !errors.Is(err, syscall.EOPNOTSUPP) && !errors.Is(err, system.ErrNotSupportedPlatform) && !errors.Is(err, syscall.EBADF) {
return errors.Wrapf(err, "failed to read %q attribute from %q", securityCapabilityXattr, path)
}
if capability != nil {