multiv09.at 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. # Process this file with autom4te to create testsuite. -*- Autotest -*-
  2. # Test suite for GNU tar.
  3. # Copyright 2015-2023 Free Software Foundation, Inc.
  4. #
  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.
  9. #
  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.
  14. #
  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/>.
  17. # Description: Tar <=1.28 would segfault extracting from a multi-volume
  18. # archive containing filenames >= 100 characters if the subsequent volume
  19. # was not set properly.
  20. # Reported by: Pavel Raiskup <[email protected]>
  21. # References: https://bugzilla.redhat.com/show_bug.cgi?id=866071,
  22. # <[email protected]>,
  23. # http://lists.gnu.org/archive/html/bug-tar/2012-11/msg00009.html
  24. AT_SETUP([bad next volume])
  25. AT_KEYWORDS([multivolume multiv multiv09])
  26. # filename of length 100 characters
  27. m4_pushdef([FILENAME],[dnl
  28. m4_for([N],1,100,,[a])])
  29. AT_TAR_CHECK([
  30. genfile --length 2000000 --file FILENAME
  31. tar --format=gnu -cM --tape-length 1M -f A.tar -f B.tar FILENAME || exit $?
  32. echo "created"
  33. tar --format=gnu -xM -f A.tar 2>/dev/null <<EOF
  34. y
  35. q
  36. EOF
  37. ],
  38. [2],
  39. [created
  40. ])
  41. AT_CLEANUP
  42. m4_popdef([FILENAME])