Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

avoid failing when lgetxattr has no data to give #526

Merged
merged 1 commit into from
Jan 24, 2024
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
12 changes: 8 additions & 4 deletions oci/layer/tar_generate.go
Original file line number Diff line number Diff line change
Expand Up @@ -219,10 +219,14 @@ func (tg *tarGenerator) AddFile(name, path string) error {
// (we'd need to use libcap to parse it).
value, err := tg.fsEval.Lgetxattr(path, name)
if err != nil {
// XXX: I'm not sure if we're unprivileged whether Lgetxattr can
// fail with EPERM. If it can, we should ignore it (like when
// we try to clear xattrs).
return errors.Wrapf(err, "get xattr: %s", name)
v := errors.Cause(err)
log.Debugf("failure reading xattr from list on %q: %q", name, v)
if v != unix.EOPNOTSUPP && v != unix.ENODATA {
// XXX: I'm not sure if we're unprivileged whether Lgetxattr can
// fail with EPERM. If it can, we should ignore it (like when
hallyn marked this conversation as resolved.
Show resolved Hide resolved
// we try to clear xattrs).
return errors.Wrapf(err, "get xattr: %s", name)
}
}
// https://golang.org/issues/20698 -- We don't just error out here
// because it's not _really_ a fatal error. Currently it's unclear
Expand Down