From: Bin Cao Date: Thu, 4 Jun 2026 10:10:28 +0000 (+0800) Subject: insane.bbclass: check for build host HOME directory in packaged files X-Git-Url: http://git.ipfire.org/gitweb/index.cgi?a=commitdiff_plain;h=35b4e7b97fc8803337bb4bcc4dc2ff2cda0c1300;p=thirdparty%2Fopenembedded%2Fopenembedded-core.git insane.bbclass: check for build host HOME directory in packaged files Extend package_qa_check_buildpaths to also detect the build host's HOME directory path in target packages. This catches cases where \$HOME-derived paths (such as userbase in Python's sysconfig) leak into the rootfs. Signed-off-by: Bin Cao Signed-off-by: Richard Purdie --- diff --git a/meta/classes-global/insane.bbclass b/meta/classes-global/insane.bbclass index 04700be71c..4250331af1 100644 --- a/meta/classes-global/insane.bbclass +++ b/meta/classes-global/insane.bbclass @@ -439,11 +439,15 @@ def package_qa_check_buildpaths(path, name, d, elf): return tmpdir = bytes(d.getVar('TMPDIR'), encoding="utf-8") + homedir = bytes(os.environ.get('HOME', ''), encoding="utf-8") with open(path, 'rb') as f: file_content = f.read() if tmpdir in file_content: path = package_qa_clean_path(path, d, name) oe.qa.handle_error("buildpaths", "File %s in package %s contains reference to TMPDIR" % (path, name), d) + if homedir and homedir in file_content: + path = package_qa_clean_path(path, d, name) + oe.qa.handle_error("buildpaths", "File %s in package %s contains reference to the build host HOME directory" % (path, name), d) QAPATHTEST[xorg-driver-abi] = "package_qa_check_xorg_driver_abi"