summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorThomas Koutcher <thomas.koutcher@online.fr>2022-08-15 22:23:02 +0200
committerThomas Koutcher <thomas.koutcher@online.fr>2022-08-15 22:23:02 +0200
commitf83b2de9c2416e14bec8329475baccc5e08f6223 (patch)
tree0579b29f0ff85eb8da8d0eec6fa7179f8f1b6324
parent340195002b1df758a9153f008242fb191c9f97ad (diff)
Fix running tests as root
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
-rw-r--r--test/tools/libgit.sh4
1 files changed, 2 insertions, 2 deletions
diff --git a/test/tools/libgit.sh b/test/tools/libgit.sh
index 138e8fed..a05c8e78 100644
--- a/test/tools/libgit.sh
+++ b/test/tools/libgit.sh
@@ -110,7 +110,7 @@ create_worktree()
create_repo_from_tgz()
{
git_init .
- tar zxf "$1"
+ tar zxof "$1"
git reset -q --hard
}
@@ -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