]> 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 13:39:17 +0000 (14:39 +0100)
Similarly to 04ee0e8b95cd8ed890374e0007f976684206b630, ensure only full
build paths are replaced in the environment to avoid breaking buildtools.

(From OE-Core rev: be07d93a4f59d4563f2d064be1997b39f05e9f0e)

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

index 4fa99acbc94c20dcef70eb757b3f9142f152a4af..8d585430be059d0c3cf3cabc1faf7601d0496a01 100644 (file)
@@ -40,7 +40,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)