Skip to content

Commit

Permalink
tar_extract: only warn for forbidden xattrs
Browse files Browse the repository at this point in the history
Closes #302

Rootless mode currently warns if a forbidden xattr is seen, while
extractions as root error out. Make root extractions warn, so that
docker images such as cern/sl6-base:latest can be extracted as root
without failing due to this error.

Signed-off-by: David Trudgian <[email protected]>
  • Loading branch information
dtrudg committed Oct 17, 2019
1 parent 3335a0d commit 72ae591
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions oci/layer/tar_extract.go
Original file line number Diff line number Diff line change
Expand Up @@ -158,11 +158,8 @@ func (te *TarExtractor) restoreMetadata(path string, hdr *tar.Header) error {
continue
}
}
if te.partialRootless {
log.Warnf("rootless{%s} ignoring forbidden xattr: %q", hdr.Name, name)
continue
}
return errors.Errorf("restore xattr metadata: saw forbidden xattr %q: %s", name, hdr.Name)
log.Warnf("xattr{%s} ignoring forbidden xattr: %q", hdr.Name, name)
continue
}
if err := te.fsEval.Lsetxattr(path, name, value, 0); err != nil {
// In rootless mode, some xattrs will fail (security.capability).
Expand Down

0 comments on commit 72ae591

Please sign in to comment.