Bug 143969 - Tar can't reliably skip over sparse files in archive
Tar can't reliably skip over sparse files in archive
Status: CLOSED RAWHIDE
Product: Fedora
Classification: Fedora
Component: tar (Show other bugs)
3
i686 Linux
medium Severity high
: ---
: ---
Assigned To: Peter Vrabec
Ben Levenson
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2005-01-02 18:04 EST by Robert Nichols
Modified: 2007-11-30 17:10 EST (History)
2 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2005-01-18 03:20:46 EST
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)
patch fix tar-1.14 (495 bytes, text/plain)
2005-01-06 09:13 EST, Peter Vrabec
no flags Details

  None (edit)
Description Robert Nichols 2005-01-02 18:04:55 EST
From Bugzilla Helper:
User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.7.5)
Gecko/20041111 Firefox/1.0

Description of problem:
When listing (-t) or extracting (-x) a subset of files in a tar
archive, and a sparse file stored with the -S option is being skipped
because it does not match the selection criteria, tar complains about
an invalid sparse member in the archive and attempts to skip to the
next header.

Version-Release number of selected component (if applicable):
tar-1.14-4

How reproducible:
Always

Steps to Reproduce:
1. echo hello | dd obs=1k seek=50 of=testfile
2. echo anything >file2
3. tar -cSf test.tar testfile file2
4. tar -tvf test.tar file2
    

Actual Results:  
tar: testfile: invalid sparse archive member
tar: Skipping to next header
-rw-r--r-- root/root         9 2005-01-02 16:49:13 file2
tar: Error exit delayed from previous errors


Expected Results:  
-rw-r--r-- root/root         9 2005-01-02 16:49:13 file2


Additional info:

"Skipping to next header" is inherently an uncertain operation which
can fail badly if one of the archive members is itself a tar archive.
 This makes use of tar for backups risky if sparse files are involved.

This is probably related to bug 11679.

This version of tar (1.14-4) appears to behave properly if the sparse
member is actually being listed or extracted from the archive.
Comment 1 Robert Nichols 2005-01-02 18:07:52 EST
Typo -- the relation is to bug 116779.
Comment 2 Peter Vrabec 2005-01-06 09:11:42 EST
It's fixed in tar-1.15.1.
http://www.gnu.org/software/tar/tar.html#downloading
Comment 3 Peter Vrabec 2005-01-06 09:13:48 EST
Created attachment 109423 [details]
patch fix tar-1.14
Comment 4 Robert Nichols 2005-01-08 16:00:34 EST
I've tested the above patch, and it appears to correct the sparse file
problem completely.
Comment 5 Oisin C. Feeley 2005-01-25 16:46:34 EST
As of Jan 25 2005 the available "tar" on a fully yum-updated system
still apparently has this problem.  How long does it take for this
sort of fix to propagate into the repository as a new .rpm ?

I'm getting a similar problem with an archive created on Red Hat 9:

[root@ars predec2004]# tar -xvf rec00628bkup.tar
tar: This does not look like a tar archive
tar: Skipping to next header
tar: Archive contains obsolescent base-64 headers
tar: Read 1320 bytes from rec00628bkup.tar
tar: Error exit delayed from previous errors

Note You need to log in before you can comment on or make changes to this bug.