1 # Process this file with autom4te to create testsuite. -*- Autotest -*-
2 # Test suite for GNU tar.
3 # Copyright 2015-2025 Free Software Foundation, Inc.
5 # GNU tar is free software; you can redistribute it and/or modify
6 # it under the terms of the GNU General Public License as published by
7 # the Free Software Foundation; either version 3 of the License, or
8 # (at your option) any later version.
10 # GNU tar is distributed in the hope that it will be useful,
11 # but WITHOUT ANY WARRANTY; without even the implied warranty of
12 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 # GNU General Public License for more details.
15 # You should have received a copy of the GNU General Public License
16 # along with this program. If not, see <http://www.gnu.org/licenses/>.
18 # Description: Tar <=1.28 would segfault extracting from a multi-volume
19 # archive containing filenames >= 100 characters if the subsequent volume
20 # was not set properly.
21 # Reported by: Pavel Raiskup <praiskup@redhat.com>
22 # References: https://bugzilla.redhat.com/show_bug.cgi?id=866071,
23 # <1351863945-31192-3-git-send-email-praiskup@redhat.com>,
24 # http://lists.gnu.org/archive/html/bug-tar/2012-11/msg00009.html
26 AT_SETUP([bad next volume])
27 AT_KEYWORDS([multivolume multiv multiv09])
29 # filename of length 100 characters
30 m4_pushdef([FILENAME],[dnl
31 m4_for([N],1,100,,[a])])
34 genfile --length 2000000 --file FILENAME
35 tar --format=gnu -cM --tape-length 1M -f A.tar -f B.tar FILENAME || exit $?
37 tar --format=gnu -xM -f A.tar 2>/dev/null <<EOF