]> code.ossystems Code Review - openembedded-core.git/commitdiff
selftest/signing: Ensure build path relocation is safe
authorRichard Purdie <richard.purdie@linuxfoundation.org>
Mon, 7 Sep 2020 15:29:52 +0000 (16:29 +0100)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Tue, 8 Sep 2020 15:43:35 +0000 (16:43 +0100)
Similarly to 04ee0e8b95cd8ed890374e0007f976684206b630, ensure only full
build paths are replaced in the environment to avoid breaking buildtools.

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
meta/lib/oeqa/selftest/cases/signing.py

index 202d54994b6fd1346890f02c9d6bfe1f619f1fa5..a28c7eb19a1545d12fb758a7067b2f1db96a1870 100644 (file)
@@ -44,7 +44,9 @@ class Signing(OESelftestTestCase):
         origenv = os.environ.copy()
 
         for e in os.environ:
-            if builddir in os.environ[e]:
+            if builddir + "/" in os.environ[e]:
+                os.environ[e] = os.environ[e].replace(builddir + "/", newbuilddir + "/")
+            if os.environ[e].endswith(builddir):
                 os.environ[e] = os.environ[e].replace(builddir, newbuilddir)
 
         os.chdir(newbuilddir)