bug-tar
[Top][All Lists]
Advanced

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

[Bug-tar] tar-1.14.90 bug with multi-volume (M) archives


From: Bruno Haible
Subject: [Bug-tar] tar-1.14.90 bug with multi-volume (M) archives
Date: Tue, 28 Sep 2004 17:42:56 +0200
User-agent: KMail/1.5

Hi,

The creation of multi-volume archives exhibits a bug that causes those
files that cross a volume boundary to be extracted with errors.

On a device with physical size 61718528 (= octal 353340000 = hex 3ADC000)
bytes I used "tar cvfM [many-files]". The result is saved as volume01,
volume02, ... The result in this case is that

$ tar tvf volume01
...
-rw------- bruno/user  1904897 2003-03-28 14:59:15 WinCvs120_src_shared.zip
tar: Unexpected EOF in archive
$ tar tvf volume02
M--------- 0/0          543489 1970-01-01 01:00:00 
WinCvs120_src_shared.zip--Continued at byte 1361408--
...

After extracting these volumes, the file WinCvs120_src_shared.zip has the
correct size, but incorrect contents, and 'tar' exits with an error:

$ tarcat volume?? | tar xvf - WinCvs120_src_shared.zip 
WinCvs120_src_shared.zip
tar: Skipping to next header
...
$ unzip -l WinCvs120_src_shared.zip Archive:  WinCvs120_src_shared.zip
  End-of-central-directory signature not found.  Either this file is not
  a zipfile, or it constitutes one disk of a multi-part archive.  In the
  latter case the central directory and zipfile comment will be found on
  the last disk(s) of this archive.
unzip:  cannot find zipfile directory in one of WinCvs120_src_shared.zip or
        WinCvs120_src_shared.zip.zip, and cannot find 
WinCvs120_src_shared.zip.ZIP, period.

or alternatively
$ tar xvfM symlink-to-volumes WinCvs120_src_shared.zip 
WinCvs120_src_shared.zip
Prepare volume #2 for `symlink-to-volumes' and hit return: 
tar: This volume is out of sequence

Looking at what 'tar' has written into volume01 and volume02, it becomes
apparent that it has written the same 2KB block of contents twice:

$ od -x original/WinCvs120_src_shared.zip | grep ' 71e1    9f5b '
5143000     71e1    9f5b    fd1f    3572    b61d    612d    93c8    0a41

$ od -x WinCvs120_src_shared.zip | grep ' 71e1    9f5b '
5143000     71e1    9f5b    fd1f    3572    b61d    612d    93c8    0a41
5147000     71e1    9f5b    fd1f    3572    b61d    612d    93c8    0a41

The first copy of this block comes from the end of volume01, the other one
from the beginning of volume02:

$ od -x volume01 | grep ' 71e1    9f5b '
353334000     71e1    9f5b    fd1f    3572    b61d    612d    93c8    0a41
$ od -x volume02 | grep ' 71e1    9f5b '
0001000     71e1    9f5b    fd1f    3572    b61d    612d    93c8    0a41

In fact, the entire 2 KB from address 353334000..353337777 (octal) of
volume01 is repeated at address 0001000..0004777 (octal) of volume02.

Bruno


(tarcat is a simple script that concatenates multiple volumes into a single
tar archive, see appended file. Why is something like this not part of the
GNU tar distribution??)

============================ tarcat ============================
#!/bin/sh
# Usage: tarcat volume1 volume2 ...
# concatenates a GNU tar multi-volume archive into a single tar archive.
set -e
cat "$1"
shift
for f
do
  dd skip=1 < "$f" 2> /dev/null
done





reply via email to

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