mirror of
https://github.com/Kitware/CMake.git
synced 2025-12-31 19:00:54 -06:00
ci: Remove superuser tools from PATH in Linux jobs
Our Linux CI jobs incidentally run as `root` in their containers, but do not need any superuser tools. Drop `sbin` entries from the `PATH`. This also avoids finding user tools through Fedora 42's `sbin -> bin` symbolic links.
This commit is contained in:
@@ -22,3 +22,10 @@ fi
|
||||
if test -r ".gitlab/ci/env_${CMAKE_CONFIGURATION}.sh"; then
|
||||
source ".gitlab/ci/env_${CMAKE_CONFIGURATION}.sh"
|
||||
fi
|
||||
|
||||
case "$(uname -s)-$(uname -m)" in
|
||||
Linux-*)
|
||||
# Remove superuser tools from PATH.
|
||||
export PATH=$(echo "$PATH" | sed 's|:[^:]*/sbin:|:|g')
|
||||
;;
|
||||
esac
|
||||
|
||||
Reference in New Issue
Block a user