[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Bug-tar] Superfluous zero blocks following sparse files

From: Lars Gustäbel
Subject: [Bug-tar] Superfluous zero blocks following sparse files
Date: Fri, 19 Jan 2007 13:04:48 +0100
User-agent: Mutt/1.5.13 (2006-08-11)


I discovered a problem in tar 1.16.1 when I archive sparse
files. The options I use are "--posix --sparse".

In the new (default) 1.0 sparse format the sparse data is stored
as part of the file data blocks before the actual file data. I
now found that after each sparse member tar 1.16.1 inserts a
sequence of superfluous zero blocks that is exactly as long as
this sparse data part.

I attached a test.tar that illustrates the issue. It has the
following anatomy:

0x000000:   [pax header]
0x000400:   regtype header ("sparse10") size field: 0xa200 (81 blocks)
0x000600:   sparse data (1 block)
0x000800:   file data (80 blocks)
0x00a800:   zeros (1 block)

0x00aa00:   [pax header]
0x00ae00:   regtype header ("sparse100") size field: 0x64600 (803 blocks)
0x00b000:   sparse data (3 blocks)
0x00b600:   file data (800 blocks)
0x06f600:   zeros (3 blocks)

0x06fc00:   [pax header]
0x070000:   regtype header ("sparse1000") size field: 0x3eb400 (8026 blocks)
0x070200:   sparse data (26 blocks)
0x073600:   file data (8000 blocks)
0x45b600:   zeros (26 blocks)

0x45ea00:   [pax header]
0x45ee00:   regtype header ("eof")

0x45f000:   zero padding
0x460000:   end of archive

Other tar programs that try to read the sparse members as
regular files (cp. bsdtar, GNU tar 1.12) will silently fail to
read all the way through because for them the zero blocks
indicate the end of the archive.

Lars Gustäbel

Truth is the invention of a liar.

Attachment: test.tar.bz2
Description: Binary data

reply via email to

[Prev in Thread] Current Thread [Next in Thread]