extrac07.at 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. # Process this file with autom4te to create testsuite. -*- Autotest -*-
  2. # Test suite for GNU tar.
  3. # Copyright 2006-2007, 2013-2014, 2016-2017 Free Software Foundation,
  4. # Inc.
  5. # This file is part of GNU tar.
  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. # 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. # You should have received a copy of the GNU General Public License
  15. # along with this program. If not, see <http://www.gnu.org/licenses/>.
  16. # Tar 1.16 failed to extract archives that have symlinks
  17. # in read-only directories.
  18. #
  19. # Reported-by: Eelco Dolstra <eelco@cs.uu.nl>
  20. # References: <45475D78.8050708@cs.uu.nl>
  21. AT_SETUP([extracting symlinks to a read-only dir])
  22. AT_KEYWORDS([extract extract07 read-only symlink chdir])
  23. AT_TAR_CHECK([
  24. AT_UNPRIVILEGED_PREREQ
  25. echo Prepare the directory
  26. mkdir dir
  27. genfile -f foo
  28. cd dir
  29. ln -s ../foo .
  30. cd ..
  31. chmod a-w dir
  32. echo Create the archive
  33. tar cf archive dir || exit 1
  34. chmod +w dir
  35. echo Extract
  36. mkdir out
  37. tar -C out -xvf archive
  38. ],
  39. [0],
  40. [Prepare the directory
  41. Create the archive
  42. Extract
  43. dir/
  44. dir/foo
  45. ],
  46. [],[],[],[ustar]) # Testing one format is enough
  47. AT_CLEANUP