Skip to content

Commit

Permalink
tarGenerator.AddFile: ignore llistxattr eopnotsupp
Browse files Browse the repository at this point in the history
If it's not supported, just assume there are no xattrs, don't
fail the addfile.

Changelog: 10/18: use errors.Cause as suggested by Tycho

Signed-off-by: Serge Hallyn <[email protected]>
  • Loading branch information
hallyn committed Oct 18, 2023
1 parent 7dc114a commit 685e414
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion oci/layer/tar_generate.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ import (
"github.com/opencontainers/umoci/pkg/system"
"github.com/opencontainers/umoci/pkg/testutils"
"github.com/pkg/errors"
"golang.org/x/sys/unix"
)

// ignoreXattrs is a list of xattr names that should be ignored when
Expand Down Expand Up @@ -201,7 +202,10 @@ func (tg *tarGenerator) AddFile(name, path string) error {
// XXX: This should probably be moved to a function in tar_unix.go.
names, err := tg.fsEval.Llistxattr(path)
if err != nil {
return errors.Wrap(err, "get xattr list")
if errors.Cause(err) != unix.EOPNOTSUPP {
return errors.Wrap(err, "get xattr list")
}
names = []string{}
}
for _, name := range names {
// Some xattrs need to be skipped for sanity reasons, such as
Expand Down

0 comments on commit 685e414

Please sign in to comment.