From ee7edb4f80edb64ff69e225d135e24fc9988504d Mon Sep 17 00:00:00 2001 From: Alexey-Ayupov <116575425+Alexey-Ayupov@users.noreply.github.com> Date: Mon, 20 May 2024 16:17:27 +0200 Subject: [PATCH] [Ubuntu] Add new git environment variable (#9899) --- images/ubuntu/scripts/build/install-git.sh | 5 +++++ images/ubuntu/scripts/tests/Tools.Tests.ps1 | 4 ++++ 2 files changed, 9 insertions(+) diff --git a/images/ubuntu/scripts/build/install-git.sh b/images/ubuntu/scripts/build/install-git.sh index f38c586e2..36122e449 100644 --- a/images/ubuntu/scripts/build/install-git.sh +++ b/images/ubuntu/scripts/build/install-git.sh @@ -6,6 +6,7 @@ # Source the helpers for use with the script source $HELPER_SCRIPTS/install.sh +source $HELPER_SCRIPTS/etc-environment.sh GIT_REPO="ppa:git-core/ppa" @@ -21,6 +22,10 @@ cat <> /etc/gitconfig directory = * EOF +# Revert to the old behaviour and avoid the Git LFS problems (https://github.blog/2024-05-14-securing-git-addressing-5-new-vulnerabilities/) +set_etc_environment_variable "GIT_CLONE_PROTECTION_ACTIVE" 'false' +reload_etc_environment + # Install git-ftp apt-get install git-ftp -y diff --git a/images/ubuntu/scripts/tests/Tools.Tests.ps1 b/images/ubuntu/scripts/tests/Tools.Tests.ps1 index 2aa7c1c3d..b5ef22500 100644 --- a/images/ubuntu/scripts/tests/Tools.Tests.ps1 +++ b/images/ubuntu/scripts/tests/Tools.Tests.ps1 @@ -244,6 +244,10 @@ Describe "Git" { It "git-ftp" { "git-ftp --version" | Should -ReturnZeroExitCode } + + It "GIT_CLONE_PROTECTION_ACTIVE environment variable should be equal false" { + $env:GIT_CLONE_PROTECTION_ACTIVE | Should -BeExactly false + } } Describe "Git-lfs" {