Skip to content

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 Sep 3, 2018
1 parent 6fd1e0e commit 1428960
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions oci/layer/tar_extract.go
Original file line number Diff line number Diff line change
Expand Up @@ -154,6 +154,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 1428960

Please sign in to comment.