multiv03.at 2.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  1. # Process this file with autom4te to create testsuite. -*- Autotest -*-
  2. # Test suite for GNU tar.
  3. # Copyright 2004-2023 Free Software Foundation, Inc.
  4. # This file is part of GNU tar.
  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. # GNU tar is distributed in the hope that it will be useful,
  10. # but WITHOUT ANY WARRANTY; without even the implied warranty of
  11. # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  12. # GNU General Public License for more details.
  13. # You should have received a copy of the GNU General Public License
  14. # along with this program. If not, see <http://www.gnu.org/licenses/>.
  15. # Problem: GNU multivolume archives are not able to continue on members
  16. # with filenames longer than 100 characters. Versions of tar <= 1.14
  17. # were not checking filename lengths and produced malformed multivolume
  18. # headers.
  19. # References: <[email protected]>
  20. # http://lists.gnu.org/archive/html/bug-tar/2004-08/msg00012.html
  21. # <[email protected]>
  22. #
  23. AT_SETUP([MV archive & long filenames])
  24. AT_KEYWORDS([multivolume multiv multiv03])
  25. AT_TAR_CHECK([
  26. AFILE=`awk 'BEGIN { for (i = 0; i < 100; i++) printf "a"; exit; }'`
  27. BFILE=`awk 'BEGIN { for (i = 0; i < 101; i++) printf "b"; exit; }'`
  28. cat > ../experr <<EOF
  29. tar: $BFILE: file name too long to be stored in a GNU multivolume header, truncated
  30. tar: '$BFILE' is possibly continued on this volume: header contains truncated name
  31. EOF
  32. cat > ../expout <<EOF
  33. $AFILE
  34. separator-1
  35. separator-2
  36. EOF
  37. genfile --length 15360 --file $AFILE
  38. exec <&-
  39. tar -M -L 10 -c -f arch.1 -f arch.2 $AFILE || exit 1
  40. tar -tM -f arch.1 -f arch.2 || exit 1
  41. echo separator-1
  42. genfile --length 15360 --file $BFILE
  43. tar -M -L 10 -c -f arch.1 -f arch.2 $BFILE || exit 1
  44. echo separator-2
  45. mv $BFILE bfile
  46. tar -M -x -f arch.1 -f arch.2 --warning=no-timestamp || exit 1
  47. cmp $BFILE bfile
  48. ],
  49. [0],
  50. [expout],
  51. [experr],
  52. [],[],[gnu, oldgnu])
  53. AT_CLEANUP