summaryrefslogtreecommitdiffstats
path: root/meta/classes
diff options
context:
space:
mode:
authorRichard Purdie <richard.purdie@linuxfoundation.org>2017-06-16 09:42:30 +0100
committerRichard Purdie <richard.purdie@linuxfoundation.org>2017-06-16 10:21:06 +0100
commitb4cf48ecee9e2c0fd4aad96911aecd1b805cfa5a (patch)
tree959fcff0a2484e7689fe9df9ec17cbac3654e465 /meta/classes
parentcf781e2f9b406075d97d363443eba4a74171a8c0 (diff)
downloadpoky-b4cf48ecee9e2c0fd4aad96911aecd1b805cfa5a.tar.gz
package_ipk: Clean up Source entry in ipk packages
There is the potential for sensitive information to leak through the urls there and removing it brings this into the behavior of the other package backends since filtering it is likely error prone. Since ipks don't appear to be generated at all if we don't set this, set the field to the recipe name used (basename only, no paths). This avoids information leaking. We may want to drop the field if opkg can allow that at a future point but the recipe name is a suitable identifier for now. Reported-by: Andrej Valek <andrej.valek@siemens.com> (From OE-Core rev: 4c353eeff45f91533f22392f129bc5a477ee5207) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/classes')
-rw-r--r--meta/classes/package_ipk.bbclass7
1 files changed, 3 insertions, 4 deletions
diff --git a/meta/classes/package_ipk.bbclass b/meta/classes/package_ipk.bbclass
index eb00932336..e7e7d4929b 100644
--- a/meta/classes/package_ipk.bbclass
+++ b/meta/classes/package_ipk.bbclass
@@ -48,6 +48,8 @@ python do_package_ipk () {
48 if os.path.exists(p): 48 if os.path.exists(p):
49 bb.utils.prunedir(p) 49 bb.utils.prunedir(p)
50 50
51 recipesource = os.path.basename(d.getVar('FILE', True))
52
51 for pkg in packages.split(): 53 for pkg in packages.split():
52 localdata = bb.data.createCopy(d) 54 localdata = bb.data.createCopy(d)
53 root = "%s/%s" % (pkgdest, pkg) 55 root = "%s/%s" % (pkgdest, pkg)
@@ -212,10 +214,7 @@ python do_package_ipk () {
212 ctrlfile.write("Replaces: %s\n" % bb.utils.join_deps(rreplaces)) 214 ctrlfile.write("Replaces: %s\n" % bb.utils.join_deps(rreplaces))
213 if rconflicts: 215 if rconflicts:
214 ctrlfile.write("Conflicts: %s\n" % bb.utils.join_deps(rconflicts)) 216 ctrlfile.write("Conflicts: %s\n" % bb.utils.join_deps(rconflicts))
215 src_uri = localdata.getVar("SRC_URI", True).strip() or "None" 217 ctrlfile.write("Source: %s\n" % recipesource)
216 if src_uri:
217 src_uri = re.sub("\s+", " ", src_uri)
218 ctrlfile.write("Source: %s\n" % " ".join(src_uri.split()))
219 ctrlfile.close() 218 ctrlfile.close()
220 219
221 for script in ["preinst", "postinst", "prerm", "postrm"]: 220 for script in ["preinst", "postinst", "prerm", "postrm"]: