diff options
author | william.r.dieter <william.r.dieter@intel.com> | 2021-01-29 19:45:04 (GMT) |
---|---|---|
committer | william.r.dieter <william.r.dieter@intel.com> | 2021-01-29 21:29:09 (GMT) |
commit | f41d0e0c773319a66acefcab81322f0519dfedae (patch) | |
tree | 75bf8b01b02858c10a2c68839e9508b4c4ed79c8 /Tests/RunCMake | |
parent | c5691f03e5626f30c432d325ab75117ad1e98bd8 (diff) | |
download | CMake-f41d0e0c773319a66acefcab81322f0519dfedae.zip CMake-f41d0e0c773319a66acefcab81322f0519dfedae.tar.gz CMake-f41d0e0c773319a66acefcab81322f0519dfedae.tar.bz2 |
Tests: Explicitly set permissions in CPack tests to avoid perimssions errors
When the user has the setgid bit is set on the parent directory of
the build directory, the setgid bit will be propagated throughout the
build tree. Most tests do not care about permissions as long as they
can read and write the files the need. The CPack tests, however, validate
that permissions match an expected set, and fail with the setgid bit set.
Explicitly set permissions on directories created in the CPackTestHelpers
to clear the setgid bit.
Signed-off-by: william.r.dieter <william.r.dieter@intel.com>
Diffstat (limited to 'Tests/RunCMake')
-rw-r--r-- | Tests/RunCMake/CPack/CPackTestHelpers.cmake | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/Tests/RunCMake/CPack/CPackTestHelpers.cmake b/Tests/RunCMake/CPack/CPackTestHelpers.cmake index 24f54c6..3ec4c69 100644 --- a/Tests/RunCMake/CPack/CPackTestHelpers.cmake +++ b/Tests/RunCMake/CPack/CPackTestHelpers.cmake @@ -21,6 +21,12 @@ function(run_cpack_test_common_ TEST_NAME types build SUBTEST_SUFFIX source PACK # TODO this should be executed only once per ctest run (not per generator) file(REMOVE_RECURSE "${RunCMake_TEST_BINARY_DIR}") file(MAKE_DIRECTORY "${RunCMake_TEST_BINARY_DIR}") + # Set permissions to those expected by the test + file(CHMOD "${RunCMake_TEST_BINARY_DIR}" + PERMISSIONS + OWNER_READ OWNER_WRITE OWNER_EXECUTE + GROUP_READ GROUP_EXECUTE + WORLD_READ WORLD_EXECUTE) if(EXISTS "${RunCMake_SOURCE_DIR}/tests/${TEST_NAME}/${GENERATOR_TYPE}-Prerequirements.cmake") include("${RunCMake_SOURCE_DIR}/tests/${TEST_NAME}/${GENERATOR_TYPE}-Prerequirements.cmake") |