Bug 258737 - tar:/ kioslave chokes on (some?) tarballs from git archive
Summary: tar:/ kioslave chokes on (some?) tarballs from git archive
Status: RESOLVED FIXED
Alias: None
Product: kio
Classification: Frameworks and Libraries
Component: tar (show other bugs)
Version: 4.5
Platform: Fedora RPMs Linux
: NOR critical
Target Milestone: ---
Assignee: David Faure
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-12-03 21:49 UTC by Kevin Kofler
Modified: 2012-05-24 22:21 UTC (History)
4 users (show)

See Also:
Latest Commit:
Version Fixed In: 4.8.1


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Kevin Kofler 2010-12-03 21:49:31 UTC
Version:           4.5 (using KDE 4.5.3) 
OS:                Linux

The tar:/ kioslave appears to choke on tarballs created by git archive, at least some specific ones, in 3 ways:
1. Some directories are entirely missing.
2. Some files show up in the toplevel directory instead of the directory they should be in.
3. A "pax_global_header" ghost file is shown.

The test case I noticed this with is the Qt Jambi 4.7.0 beta2 tarball provided by upstream:
http://sourceforge.net/projects/qtjambi/files/4.7.0-beta2/qtjambi-src-4.7-beta2.tar.gz/download
I tried generating my own from their git repository using:
git archive --format=tar --prefix=qtjambi-4.7-20101203/ master | bzip2 -9 >../qtjambi-4.7-20101203.tar.bz2
and got the same behavior.

Reproducible: Didn't try

Steps to Reproduce:
1. Download the reproducer from the Qt Jambi project (12.2 MB / 11.7 MiB):
http://sourceforge.net/projects/qtjambi/files/4.7.0-beta2/qtjambi-src-4.7-beta2.tar.gz/download
2. Try to view it using the tar:/ kioslave.

Actual Results:  
The 3 issues I listed above.

Expected Results:  
A complete directory listing with all files and directories present and in the correct location and without internal pseudo-files such as "pax_global_header".

I don't know whether the Qt Jambi git repository is somehow special or whether this happens with others too. If this affects many or even all git repositories, this is a very bad issue. More and more projects are going to use git export.

This bug can also cause data loss if you use tar:/ to extract the contents of a tarball and expect them to be complete (though that's probably not the common use case).

This bug may or may not be related to bug 206994.
Comment 1 Jekyll Wu 2012-01-02 11:07:39 UTC
I just noticed another archive which exhibits the ghost 'pax_global_header' file

http://ftp.gnu.org/gnu/libc/glibc-2.14.1.tar.bz2
Comment 2 Kevin Kofler 2012-02-20 22:34:55 UTC
These days, this also affects several of KDE's own tarballs (even core tarballs of the software compilation), which makes this particularly painful and embarrassing!
Comment 3 David Faure 2012-02-21 10:34:07 UTC
Mario, do you want to take a look? :-)
Comment 4 Mario Bensi 2012-02-21 11:41:00 UTC
yes, I can reproduce the bug, next step find a fix.
Comment 5 Mario Bensi 2012-02-27 16:36:19 UTC
Git commit 262cf5920c9c0d9619d384bcf0298615c2060b44 by Mario Bensi.
Committed on 24/02/2012 at 18:08.
Pushed by bensi into branch 'KDE/4.8'.

Test Global extended header

Add a test on Global extended header, if we find the 'g' flag we need to
skip the file, the Global extended header shouldn't be appear in the
result of read

REVIEW: 104065

M  +9    -1    kdecore/io/ktar.cpp
A  +-    --    kdecore/tests/global_header_test.tar.bz2
M  +19   -0    kdecore/tests/karchivetest.cpp
M  +1    -0    kdecore/tests/karchivetest.h

http://commits.kde.org/kdelibs/262cf5920c9c0d9619d384bcf0298615c2060b44
Comment 6 Mario Bensi 2012-02-27 16:36:19 UTC
Git commit 762136bc525d84215bfbcbedc995431e8b66b181 by Mario Bensi.
Committed on 24/02/2012 at 18:11.
Pushed by bensi into branch 'KDE/4.8'.

Test and add prefix value

We can have a prefix value in header at 0x159, if the value of the
prefix are not null, we need to add this to the name value, with '/' to
separate.

REVIEW: 104067

M  +5    -0    kdecore/io/ktar.cpp
M  +26   -0    kdecore/tests/karchivetest.cpp
M  +1    -0    kdecore/tests/karchivetest.h
A  +-    --    kdecore/tests/tar_prefix_test.tar.bz2

http://commits.kde.org/kdelibs/762136bc525d84215bfbcbedc995431e8b66b181
Comment 7 Mario Bensi 2012-02-27 16:36:19 UTC
Git commit 6e0d694b302b57883ed79a3b47c9d60bea20dc8e by Mario Bensi.
Committed on 24/02/2012 at 18:15.
Pushed by bensi into branch 'KDE/4.8'.

Test also the prefix value

We need to test if there is a prefix value because the file name can be
null and the prefix can have a value and in this case we don't reset
n.

REVIEW: 104068

M  +3    -1    kdecore/io/ktar.cpp
M  +27   -0    kdecore/tests/karchivetest.cpp
M  +1    -0    kdecore/tests/karchivetest.h
A  +-    --    kdecore/tests/tar_directory_forgotten.tar.bz2

http://commits.kde.org/kdelibs/6e0d694b302b57883ed79a3b47c9d60bea20dc8e
Comment 8 Jan Lepper 2012-05-24 16:43:44 UTC
Can somebody confirm that https://bugs.kde.org/show_bug.cgi?id=206994
and https://bugs.kde.org/show_bug.cgi?id=290376 are  duplicates of this ?
Comment 9 Kevin Kofler 2012-05-24 22:21:24 UTC
Bug #206994 is NOT a duplicate of this bug.