extrac21.at 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. # Test suite for GNU tar. -*- Autotest -*-
  2. # Copyright 2017-2023 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. # When called with the --delay-directory-restore option, tar would
  19. # in some cases restore the directory permissions too early, before
  20. # attempting to replace softlink placeholders with the actual link.
  21. # This caused failure if the permissions forbade writing.
  22. #
  23. # The bug was caused by incorrect assumption about delayed_set_stat
  24. # ordering in create_placeholder_file.
  25. #
  26. # Reported by: Giuseppe Scrivano <[email protected]>
  27. # References: <[email protected]>,
  28. # <http://lists.gnu.org/archive/html/bug-tar/2017-11/msg00009.html>
  29. AT_SETUP([delay-directory-restore])
  30. AT_KEYWORDS([extract extract21 read-only symlink delay-directory-restore])
  31. AT_TAR_CHECK([
  32. AT_UNPRIVILEGED_PREREQ
  33. mkdir a a/b a/c
  34. genfile --file a/b/D
  35. genfile --file a/c/A
  36. cd a/b
  37. ln -sf ../c/A
  38. cd ../..
  39. chmod a-w a/b
  40. tar --no-recurs -c -f A.tar a a/b a/b/D a/c a/b/A a/c/A
  41. mkdir out
  42. tar -C out -v -x -f A.tar --delay-directory-restore
  43. ],
  44. [0],
  45. [a/
  46. a/b/
  47. a/b/D
  48. a/c/
  49. a/b/A
  50. a/c/A
  51. ],
  52. [],[],[],[ustar]) # Testing one format is enough
  53. AT_CLEANUP