Skip to content

Commit

Permalink
Fix running tests as root
Browse files Browse the repository at this point in the history
CVE-2022-24765 mitigation in Git v2.35.2 introduced a check of
ownership, so make sure untarred .git content belongs to the current
user when running tests.

Fixes #1224
  • Loading branch information
koutcher committed Aug 15, 2022
1 parent 3401950 commit f83b2de
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions test/tools/libgit.sh
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ create_worktree()
create_repo_from_tgz()
{
git_init .
tar zxf "$1"
tar zxof "$1"
git reset -q --hard
}

Expand All @@ -121,7 +121,7 @@ git_clone()
clone_dir="${2:-$work_dir}"
(cd "$clone_dir" && {
git_init .
tar zxf "$repo_tgz"
tar zxof "$repo_tgz"
git reset -q --hard
})
else
Expand Down

0 comments on commit f83b2de

Please sign in to comment.