mirror of
https://git.yoctoproject.org/poky
synced 2026-01-29 21:08:42 +01:00
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. (From OE-Core rev: db8ceed8f2eca92a4cffe8295481d8041281fdd0) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
This commit is contained in:
@@ -44,7 +44,9 @@ class Signing(OESelftestTestCase):
|
|||||||
origenv = os.environ.copy()
|
origenv = os.environ.copy()
|
||||||
|
|
||||||
for e in os.environ:
|
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.environ[e] = os.environ[e].replace(builddir, newbuilddir)
|
||||||
|
|
||||||
os.chdir(newbuilddir)
|
os.chdir(newbuilddir)
|
||||||
|
|||||||
Reference in New Issue
Block a user