extrac07.at 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. # Process this file with autom4te to create testsuite. -*- Autotest -*-
  2. # Test suite for GNU tar.
  3. # Copyright 2006-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. # Tar 1.16 failed to extract archives that have symlinks
  16. # in read-only directories.
  17. #
  18. # Reported-by: Eelco Dolstra <[email protected]>
  19. # References: <[email protected]>
  20. AT_SETUP([extracting symlinks to a read-only dir])
  21. AT_KEYWORDS([extract extract07 read-only symlink chdir])
  22. AT_TAR_CHECK([
  23. AT_UNPRIVILEGED_PREREQ
  24. echo Prepare the directory
  25. mkdir dir
  26. genfile -f foo
  27. cd dir
  28. ln -s ../foo .
  29. cd ..
  30. chmod a-w dir
  31. echo Create the archive
  32. tar cf archive dir || exit 1
  33. chmod +w dir
  34. echo Extract
  35. mkdir out
  36. tar -C out -xvf archive
  37. ],
  38. [0],
  39. [Prepare the directory
  40. Create the archive
  41. Extract
  42. dir/
  43. dir/foo
  44. ],
  45. [],[],[],[ustar]) # Testing one format is enough
  46. AT_CLEANUP