Explorar el Código

selftest/signing: Ensure build path relocation is safe

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>
Richard Purdie hace 3 años
padre
commit
db8ceed8f2
Se han modificado 1 ficheros con 3 adiciones y 1 borrados
  1. 3 1
      meta/lib/oeqa/selftest/cases/signing.py

+ 3 - 1
meta/lib/oeqa/selftest/cases/signing.py

@@ -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)