extrac25.at 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. # Test suite for GNU tar. -*- autotest -*-
  2. # Copyright 2022 Free Software Foundation, Inc.
  3. #
  4. # This file is part of GNU tar.
  5. #
  6. # GNU tar is free software; you can redistribute it and/or modify
  7. # it under the terms of the GNU General Public License as published by
  8. # the Free Software Foundation; either version 3 of the License, or
  9. # (at your option) any later version.
  10. #
  11. # GNU tar is distributed in the hope that it will be useful,
  12. # but WITHOUT ANY WARRANTY; without even the implied warranty of
  13. # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  14. # GNU General Public License for more details.
  15. #
  16. # You should have received a copy of the GNU General Public License
  17. # along with this program. If not, see <http://www.gnu.org/licenses/>.
  18. AT_SETUP([extract over parent dir that is dangling symlink])
  19. AT_KEYWORDS([extract extrac25 to-stdout])
  20. # Description: When extracting over pipe, only regular files should be
  21. # extracted. In tar 1.33 this was broken, so that members of other types
  22. # (in particular, directories) were extracted as usual. This test ensures
  23. # that this is no longer the case.
  24. #
  25. # References: https://bugs.archlinux.org/task/69373,
  26. # https://savannah.gnu.org/bugs/?60002
  27. AT_TAR_CHECK([
  28. mkdir subdir
  29. touch subdir/a.txt
  30. tar -cf test.tar subdir/a.txt
  31. rm -rf subdir
  32. ln -s does_not_exist subdir
  33. tar -xvf test.tar
  34. ],
  35. [2],
  36. [subdir/a.txt
  37. ],
  38. [tar: subdir: Cannot mkdir: File exists
  39. tar: subdir/a.txt: Cannot open: No such file or directory
  40. tar: Exiting with failure status due to previous errors
  41. ])
  42. AT_CLEANUP