summaryrefslogtreecommitdiffstats
path: root/meta/classes-global
diff options
context:
space:
mode:
authorAlexander Kanavin <alex.kanavin@gmail.com>2024-01-26 14:34:53 +0100
committerRichard Purdie <richard.purdie@linuxfoundation.org>2024-01-27 08:20:02 +0000
commit683c839c457673a0c455bd224181f3a3953ef617 (patch)
tree03f2511706b3f449f06c011deab9f45d94c44ca2 /meta/classes-global
parent2b20d612b4b69e8d5eebf17751517d51586fb079 (diff)
downloadpoky-683c839c457673a0c455bd224181f3a3953ef617.tar.gz
classes/package_rpm: set bogus locations for passwd/group files
Since https://github.com/rpm-software-management/rpm/commit/f3eaeeb7341085e1850e914350cf1f33d538320d rpm does its own parsing of /etc/passwd and /etc/group instead of relying on getpwnam() and friends. This has an unfortunate effect of leaking build host uid/gid values for users and groups into the cpio header inside rpm file (where previously those were always zero). Installation of rpm packages relies on rpm header to set files ownership, and that is a different structure that is build from .spec information, so we can avoid host contamination by setting the paths to something bogus. (From OE-Core rev: ac8ea64bb39a5e56599e078c7e6cd056a2aa4144) Signed-off-by: Alexander Kanavin <alex@linutronix.de> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/classes-global')
-rw-r--r--meta/classes-global/package_rpm.bbclass2
1 files changed, 2 insertions, 0 deletions
diff --git a/meta/classes-global/package_rpm.bbclass b/meta/classes-global/package_rpm.bbclass
index 3ca6c5aa7b..e0f4de42a1 100644
--- a/meta/classes-global/package_rpm.bbclass
+++ b/meta/classes-global/package_rpm.bbclass
@@ -722,6 +722,8 @@ python do_package_rpm () {
722 cmd = cmd + " --define 'debug_package %{nil}'" 722 cmd = cmd + " --define 'debug_package %{nil}'"
723 cmd = cmd + " --define '_tmppath " + workdir + "'" 723 cmd = cmd + " --define '_tmppath " + workdir + "'"
724 cmd = cmd + " --define '_use_weak_usergroup_deps 1'" 724 cmd = cmd + " --define '_use_weak_usergroup_deps 1'"
725 cmd = cmd + " --define '_passwd_path " + "/completely/bogus/path" + "'"
726 cmd = cmd + " --define '_group_path " + "/completely/bogus/path" + "'"
725 if d.getVarFlag('ARCHIVER_MODE', 'srpm') == '1' and bb.data.inherits_class('archiver', d): 727 if d.getVarFlag('ARCHIVER_MODE', 'srpm') == '1' and bb.data.inherits_class('archiver', d):
726 cmd = cmd + " --define '_sourcedir " + d.getVar('ARCHIVER_OUTDIR') + "'" 728 cmd = cmd + " --define '_sourcedir " + d.getVar('ARCHIVER_OUTDIR') + "'"
727 cmdsrpm = cmd + " --define '_srcrpmdir " + d.getVar('ARCHIVER_RPMOUTDIR') + "'" 729 cmdsrpm = cmd + " --define '_srcrpmdir " + d.getVar('ARCHIVER_RPMOUTDIR') + "'"