xattr04.at 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. # Process this file with autom4te to create testsuite. -*- Autotest -*-
  2. #
  3. # Test suite for GNU tar.
  4. # Copyright 2012-2023 Free Software Foundation, 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. #
  17. # Test description: Test for the regression caused by tar update from 1.23 to
  18. # 1.26, Red Hat xattr patch was not ready for open->openat conversion.
  19. #
  20. # Related commit 4bde4f3. See the bug: https://bugzilla.redhat.com/717684
  21. AT_SETUP([xattrs: s/open/openat/ regression])
  22. AT_KEYWORDS([xattrs xattr04 chdir])
  23. AT_TAR_CHECK([
  24. AT_XATTRS_PREREQ
  25. mkdir dir
  26. mkdir output
  27. genfile --file dir/file
  28. setfattr -n user.test -v value dir/file
  29. # archive whole directory including binary xattrs
  30. tar --xattrs -cf archive.tar -C dir .
  31. tar --xattrs -xf archive.tar -C output
  32. ret=$?
  33. getfattr -h -d output/file | grep -v -e '^#' -e ^$
  34. exit $ret
  35. ],
  36. [0],
  37. [user.test="value"
  38. ])
  39. AT_CLEANUP