From 609d6de7451ce46941c73257525e1a401e7241e2 Mon Sep 17 00:00:00 2001 From: Ross Burton Date: Fri, 6 May 2022 16:56:00 +0100 Subject: oeqa/selftest: add test for git working correctly inside pseudo The fix for CVE-2022-24765 in git[1] breaks any use of git inside pseudo. Add a simple test case to oe-selftest to verify that at least basic uses of git work fine under pseudo. [1] https://github.com/git/git/commit/8959555cee7ec045958f9b6dd62e541affb7e7d9 (From OE-Core rev: c1b43595a023e481daeb6005c431f51897aeb45d) Signed-off-by: Ross Burton Signed-off-by: Richard Purdie (cherry picked from commit 46822268040a23dbb81f71fe35aee8c2663a31f6) Signed-off-by: Anuj Mittal Signed-off-by: Richard Purdie --- meta/lib/oeqa/selftest/cases/git.py | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 meta/lib/oeqa/selftest/cases/git.py (limited to 'meta') diff --git a/meta/lib/oeqa/selftest/cases/git.py b/meta/lib/oeqa/selftest/cases/git.py new file mode 100644 index 0000000000..f12874dc7d --- /dev/null +++ b/meta/lib/oeqa/selftest/cases/git.py @@ -0,0 +1,15 @@ +from oeqa.selftest.case import OESelftestTestCase +from oeqa.utils.commands import bitbake + +class GitCheck(OESelftestTestCase): + def test_git_intercept(self): + """ + Git binaries with CVE-2022-24765 fixed will refuse to operate on a + repository which is owned by a different user. This breaks our + do_install task as that runs inside pseudo, so the git repository is + owned by the build user but git is running as (fake)root. + + We have an intercept which disables pseudo, so verify that it works. + """ + bitbake("git-submodule-test -c test_git_as_user") + bitbake("git-submodule-test -c test_git_as_root") -- cgit v1.2.3-54-g00ecf