diff --git a/bin/distcc/distcc_server_bootstrap.sh b/bin/distcc/distcc_server_bootstrap.sh index 187366478..3c5ee77d7 100755 --- a/bin/distcc/distcc_server_bootstrap.sh +++ b/bin/distcc/distcc_server_bootstrap.sh @@ -36,8 +36,8 @@ fi OS_ID=$(source /etc/os-release && echo $ID) OS_VERSION=$(source /etc/os-release && echo $VERSION_ID) if [[ "$OS_ID" == Ubuntu ]]; then - if ! [[ $OS_VERSION == 16.04 || $OS_VERSION == 18.04 ]]; then - echo "This script only supports Ubuntu 16.04 and 18.04" >&2 + if ! [[ $OS_VERSION == 16.04 || $OS_VERSION == 18.04 || $OS_VERSION == 20.04 ]]; then + echo "This script only supports Ubuntu 16.04, 18.04, and 20.04" >&2 exit 1 fi fi @@ -72,4 +72,9 @@ sudo -u distccd -H bash <<"EOF" DOWNLOAD_CDH_COMPONENTS=false ./bin/bootstrap_toolchain.py EOF +# To resolve CVE-2004-2687, newer distcc versions only allow programs to be executed +# if they have a symlink under '/usr/lib/distcc'. +# https://github.com/distcc/distcc/commit/dfb45b528746bf89c030fccac307ebcf7c988512 +sudo ln -s $(which ccache) /usr/lib/distcc/ccache + (cd impala && ./bin/distcc/distcc_server_setup.sh "$@") diff --git a/bin/distcc/distcc_server_setup.sh b/bin/distcc/distcc_server_setup.sh index 8d5d7bb98..05a88d90b 100755 --- a/bin/distcc/distcc_server_setup.sh +++ b/bin/distcc/distcc_server_setup.sh @@ -60,8 +60,9 @@ ALLOWED_NETS=$1 OS_ID=$(source /etc/os-release && echo "$ID") OS_VERSION=$(source /etc/os-release && echo "$VERSION_ID") if [[ "$OS_ID" == ubuntu ]]; then - if ! [[ $OS_VERSION == 14.04 || $OS_VERSION == 16.04 || $OS_VERSION == 18.04 ]]; then - echo "This script only supports Ubuntu 14.04, 16.04 and 18.04" >&2 + if ! [[ $OS_VERSION == 14.04 || $OS_VERSION == 16.04 || $OS_VERSION == 18.04 || \ + $OS_VERSION == 20.04 ]]; then + echo "This script only supports Ubuntu 14.04, 16.04, 18.04, and 20.04" >&2 exit 1 fi LINUX_FLAVOUR=ubuntu @@ -125,3 +126,9 @@ service ${DISTCCD_SERVICE} restart echo "Symlinking /opt/Impala-Toolchain to default toolchain location" ln -f -s -T "${IMPALA_HOME}/toolchain" /opt/Impala-Toolchain + +# To resolve CVE-2004-2687, newer distcc versions only allow programs to be executed +# if they have a symlink under '/usr/lib/distcc'. +# https://github.com/distcc/distcc/commit/dfb45b528746bf89c030fccac307ebcf7c988512 +echo "Creating symlink for ccache:" +ln -s $(which ccache) /usr/lib/distcc/ccache