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

fails to parse gnu tar xattrs (CentOS Docker base image) #752

Closed
cgwalters opened this issue Jul 28, 2016 · 7 comments
Closed

fails to parse gnu tar xattrs (CentOS Docker base image) #752

cgwalters opened this issue Jul 28, 2016 · 7 comments

Comments

@cgwalters
Copy link

The CentOS docker base image is created ultimately via a tool that ultimately uses GNU tar. In CentOS, the /usr/bin/ping binary has file capabilities.

We're trying to import this tarball into OSTree which ultimately uses libarchive.

ostree --repo=../repo commit --tar-autocreate-parents -b centos-docker-base --tree=tar=8c3d77a518cbc66dad00ac5b6061a4d7c7f14c3d8b516c7d635642d11418cd29.tar 
error: Ignoring malformed pax extended attribute

Now, ostree is currently treating the warning as fatal, which we could easily change, but at the cost of losing the xattr here. I thought libarchive was able to parse GNU xattrs, but this case seems to fail.

Minimal reproducer looks like:

$ rpm -q tar libarchive
tar-1.28-7.fc24.x86_64
libarchive-3.1.2-17.fc24.x86_64
$ tar -c --xattrs -f ping.tar /usr/bin/ping
$ bsdtar -tf ping.tar 
bsdtar: Ignoring malformed pax extended attribute
usr/bin/ping
bsdtar: Error exit delayed from previous errors.
@jsonn
Copy link
Contributor

jsonn commented Jul 28, 2016

Can you attach an example tar file please?

@cgwalters
Copy link
Author

ping.tar.gz

@cgwalters
Copy link
Author

I generated this by simply doing (with the same binaries as above, though this time as root so I could easily set the security attribute):

# touch ping
# setfattr -n security.capability -v test
# tar -c --xattrs -f ping.tar ping
# gzip ping.tar

@kientzle
Copy link
Contributor

A long time ago, star and libarchive implemented xattr support in slightly different ways. GNU tar chose to copy their implementation from star rather than from libarchive.

There's a pull request to add the ability to read star-format xattr entries to libarchive. I've not yet had time to review it thoroughly, but it's certainly on my to-do list.

@cgwalters
Copy link
Author

#691

@mmatuska
Copy link
Member

Is this still an issue after #691 has been merged?

@kientzle
Copy link
Contributor

This should have been fixed with #691

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants