bug-tar
[Top][All Lists]
Advanced

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

[Bug-tar] [PATCH 2/5] New test for extraction of multi-volume archives


From: Pavel Raiskup
Subject: [Bug-tar] [PATCH 2/5] New test for extraction of multi-volume archives
Date: Fri, 2 Nov 2012 14:45:42 +0100

Actual version of tar fails with segfault when the name of currently
extracted file is longer than 99 bytes, the file is split among more than
one part and user gives to tar bad second or subsequent volume name (the
situation occurs very easily when user does not know what to do when tar
asks for the next volume - user simply presses enter and tar reuses the
actual volume).

Fix for this bug resides in following commit.

* tests/Makefile.am: enable test 'multiv09.at'
* tests/testsuite.at: enable test 'multiv09.at'
* tests/multiv09.at: new test case
---
 tests/Makefile.am  |  1 +
 tests/multiv09.at  | 41 +++++++++++++++++++++++++++++++++++++++++
 tests/testsuite.at |  1 +
 3 files changed, 43 insertions(+)
 create mode 100644 tests/multiv09.at

diff --git a/tests/Makefile.am b/tests/Makefile.am
index 4601e0e..0250322 100644
--- a/tests/Makefile.am
+++ b/tests/Makefile.am
@@ -127,6 +127,7 @@ TESTSUITE_AT = \
  multiv06.at\
  multiv07.at\
  multiv08.at\
+ multiv09.at\
  old.at\
  options.at\
  options02.at\
diff --git a/tests/multiv09.at b/tests/multiv09.at
new file mode 100644
index 0000000..5e06f94
--- /dev/null
+++ b/tests/multiv09.at
@@ -0,0 +1,41 @@
+# Test suite for GNU tar.                             -*- Autotest -*-
+# Copyright (C) 2012 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: Tar 1.26 would fail with segfault during extracting
+# multi-volume archive containging filenames >= 100 characters in a case
+# that second or subsequent volume was not set properly.
+#
+# See: https://bugzilla.redhat.com/show_bug.cgi?id=866071
+
+AT_SETUP([don't segfault during extraction])
+AT_KEYWORDS([multivolume multiv multiv09])
+
+AT_TAR_CHECK([
+# filename of length 100 characters
+FNAME=`echo $( seq 1 100 | sed s/.*/a/ ) | tr -d " "`
+genfile --length 2000000 --file $FNAME
+tar --format=gnu -cM --tape-length 1M -f A.tar -f B.tar $FNAME >/dev/null || 
exit 1
+echo "created"
+tar --format=gnu -xM -f A.tar 2>/dev/null <<EOF
+y
+q
+EOF
+],
+[2],
+[created
+])
+
+AT_CLEANUP
diff --git a/tests/testsuite.at b/tests/testsuite.at
index 97f5e41..fc1fc5f 100644
--- a/tests/testsuite.at
+++ b/tests/testsuite.at
@@ -222,6 +222,7 @@ m4_include([multiv05.at])
 m4_include([multiv06.at])
 m4_include([multiv07.at])
 m4_include([multiv08.at])
+m4_include([multiv09.at])
 
 m4_include([old.at])
 m4_include([owner.at])
-- 
1.7.11.7




reply via email to

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