From f41d0e0c773319a66acefcab81322f0519dfedae Mon Sep 17 00:00:00 2001 From: "william.r.dieter" Date: Fri, 29 Jan 2021 14:45:04 -0500 Subject: 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 --- Tests/RunCMake/CPack/CPackTestHelpers.cmake | 6 ++++++ 1 file changed, 6 insertions(+) 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") -- cgit v0.12 From 8213390a3e726bb7aaa0623c548b2cabcc1ca8a5 Mon Sep 17 00:00:00 2001 From: "william.r.dieter" Date: Fri, 29 Jan 2021 14:42:56 -0500 Subject: Added `SETUID` and `SETGID` to the list of accepted file permissions Signed-off-by: william.r.dieter --- Help/command/file.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Help/command/file.rst b/Help/command/file.rst index 76a07f9..c64b13f 100644 --- a/Help/command/file.rst +++ b/Help/command/file.rst @@ -825,7 +825,7 @@ which would make them unable to support a hard link. Set the permissions for the ``...`` and ``...`` specified. Valid permissions are ``OWNER_READ``, ``OWNER_WRITE``, ``OWNER_EXECUTE``, ``GROUP_READ``, ``GROUP_WRITE``, ``GROUP_EXECUTE``, ``WORLD_READ``, -``WORLD_WRITE``, ``WORLD_EXECUTE``. +``WORLD_WRITE``, ``WORLD_EXECUTE``, ``SETUID``, ``SETGID``. Valid combination of keywords are: -- cgit v0.12