]> git.ipfire.org Git - thirdparty/openembedded/openembedded-core.git/commitdiff
insane.bbclass: check for build host HOME directory in packaged files
authorBin Cao <bin.cao.cn@windriver.com>
Thu, 4 Jun 2026 10:10:28 +0000 (18:10 +0800)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Fri, 5 Jun 2026 14:50:15 +0000 (15:50 +0100)
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 <bin.cao.cn@windriver.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
meta/classes-global/insane.bbclass

index 04700be71c636006e0d1d75a68bbf20d9076cbfb..4250331af129539264a741c28c6437da1f427056 100644 (file)
@@ -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"