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

tracker: tar 1.34 replace barfs: Skipping to next header #21373

Closed
edsantiago opened this issue Jan 25, 2024 · 2 comments
Closed

tracker: tar 1.34 replace barfs: Skipping to next header #21373

edsantiago opened this issue Jan 25, 2024 · 2 comments
Labels
locked - please file new issue/PR Assist humans wanting to comment on an old issue or PR with locked comments.

Comments

@edsantiago
Copy link
Member

Copy-paste and save as test-tar:

#!/bin/bash

set -ex

IMG=${1?Missing IMAGE arg}

tmpdir=$(mktemp -d --tmpdir test-tar.XXXXXXX)

echo cd $tmpdir
cd $tmpdir

touch file1
echo "modified" >file2

cat >Containerfile <<EOF
FROM $IMG
ADD file1 /tmp
WORKDIR /tmp
EOF

podman rmi -f testimage

podman build -t testimage .
podman create --name testctr testimage
podman export -o ctr.tar testctr
podman rm testctr

tar --delete -f ctr.tar tmp/file1
tar -rf ctr.tar file2

With tar-1.34-8.fc38.x86_64:

  • Run script with quay.io/libpod/testimage:20221018. It passes.
  • Run script with quay.io/libpod/testimage:20240123. It fails:
...
+ tar --delete -f ctr.tar tmp/file1
+ tar -rf ctr.tar file2
tar: Skipping to next header
tar: Exiting with failure status due to previous errors
# echo $?
2

Works perfectly fine with tar-1.35-2.fc39.x86_64. The question is, was this an intentional bug fix in 1.35, or is it just luck that it works in 1.35 and we will see this again?

Filing under podman because I need a holding place somewhere.

@giuseppe
Copy link
Member

yes, this is indeed a GNU tar bug that is fixed in the 1.35 release.

I've bisected GNU tar and can confirm the following patch fixes the issue with --delete: https://git.savannah.gnu.org/cgit/tar.git/commit/?id=f8e14746d2ca72804a4520c059d7bf65ca00c5ac

@edsantiago
Copy link
Member Author

Thank you @giuseppe!

@github-actions github-actions bot added the locked - please file new issue/PR Assist humans wanting to comment on an old issue or PR with locked comments. label Apr 26, 2024
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Apr 26, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
locked - please file new issue/PR Assist humans wanting to comment on an old issue or PR with locked comments.
Projects
None yet
Development

No branches or pull requests

2 participants