Skip to content
This repository has been archived by the owner on Jun 21, 2020. It is now read-only.

Commit

Permalink
layer: ignore ENOTSUP on setxattr
Browse files Browse the repository at this point in the history
This mirrors existing behaviour within Docker or similar tools, where we
ignore lsetxattr(2) failures because there's not much you can do if the
filesystem doesn't support it.

Signed-off-by: Aleksa Sarai <asarai@suse.de>
  • Loading branch information
cyphar committed Aug 31, 2018
1 parent eee6046 commit aaafa0b
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions oci/layer/tar_extract.go
Expand Up @@ -149,6 +149,13 @@ func (te *TarExtractor) restoreMetadata(path string, hdr *tar.Header) error {
log.Warnf("rootless{%s} ignoring (usually) harmless EPERM on setxattr %q", hdr.Name, name)
continue
}
// We cannot do much if we get an ENOTSUPP -- this usually means
// that extended attributes are simply unsupported by the
// underlying filesystem (such as AUFS or NFS).
if errors.Cause(err) == unix.ENOTSUP {
log.Warnf("xatt{%s} ignoring ENOTSUPP on setxattr %q", hdr.Name, name)
continue
}
return errors.Wrapf(err, "restore xattr metadata: %s", path)
}
}
Expand Down

0 comments on commit aaafa0b

Please sign in to comment.