]> code.ossystems Code Review - openembedded-core.git/commitdiff
selftest/signing: Ensure build path relocation is safe zeus
authorRichard Purdie <richard.purdie@linuxfoundation.org>
Mon, 7 Sep 2020 15:29:52 +0000 (16:29 +0100)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Thu, 10 Sep 2020 12:21:45 +0000 (13:21 +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 5c4e01b2c36ce26d356273896490df57333101a0..5b8f9bbd3887e848a751153285c04ba7a20dd364 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)