Files
tar/tests/multiv07.at
Sergey Poznyakoff c3fa22fc80 Read POSIX multivolume archives split at the header boundary.
* src/common.h (read_header_mode): New enum.
(read_header): Change type of the 3rd argument.
* src/list.c (read_header): Change type of the 3rd argument.
All callers updated.
* src/buffer.c (try_new_volume): Allow for volumes split at the
extended/ustar header boundary. This is against POSIX specs, but
we must be able to read such archives anyway.

* tests/multiv07.at: New test case.
* tests/Makefile.am: Add multiv07.at
* tests/testsuite.at: Likewise.

* src/compare.c: Update calls to read_header.
* src/delete.c: Likewise.
* src/update.c: Likewise.
2010-01-25 17:03:28 +02:00

44 lines
1.6 KiB
Plaintext

# Test suite for GNU tar. -*- Autotest -*-
# Copyright (C) 2010 Free Software Foundation, Inc.
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 3, or (at your option)
# any later version.
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
# Description: When creating POSIX multivolume archives, tar may in
# some cases write an extended header at the end of one volume, and
# the corresponding ustar header at the beginning of the next volume.
# Such archives do not fully comply with the POSIX specs, but tar must
# be able to read them anyway. This is what this script tests.
#
# See function try_new_volume, in file src/buffer.c near line 1227
# for additional details.
AT_SETUP([volumes split at an extended header])
AT_KEYWORDS([multivolume multiv multiv07 xsplit])
AT_CHECK([
AT_XFAIL_IF(test -f $[]XFAILFILE)
AT_TARBALL_PREREQ([xsplit-1.tar],[0e008c84c517e48fbf23ca6a7033cde6])
AT_TARBALL_PREREQ([xsplit-2.tar],[03150b9852d285458f43734e9e0b9a45])
cd $TEST_DATA_DIR
tar -t -M -fxsplit-1.tar -fxsplit-2.tar
],
[0],
[Archive volumes split at an extended header Volume 1
foo
bar
])
AT_CLEANUP