mirror of
https://git.yoctoproject.org/poky
synced 2026-05-09 17:39:31 +00:00
classes: sanity-check LIC_FILES_CHKSUM
We assume that LIC_FILES_CHKSUM is a file: URI but don't actually verify this, which can lead to problems if you have a URI that resolves to a path of / as Bitbake will then dutifully checksum / recursively. [ YOCTO #12883 ] (From OE-Core rev: e2b8a3d5a10868f9c0dec8d7b9f5f89fdd100fc8) Signed-off-by: Ross Burton <ross.burton@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
This commit is contained in:
committed by
Richard Purdie
parent
4b2513defa
commit
a316be88cd
@@ -100,8 +100,8 @@ def get_lic_checksum_file_list(d):
|
|||||||
# We only care about items that are absolute paths since
|
# We only care about items that are absolute paths since
|
||||||
# any others should be covered by SRC_URI.
|
# any others should be covered by SRC_URI.
|
||||||
try:
|
try:
|
||||||
path = bb.fetch.decodeurl(url)[2]
|
(method, host, path, user, pswd, parm) = bb.fetch.decodeurl(url)
|
||||||
if not path:
|
if method != "file" or not path:
|
||||||
raise bb.fetch.MalformedUrl(url)
|
raise bb.fetch.MalformedUrl(url)
|
||||||
|
|
||||||
if path[0] == '/':
|
if path[0] == '/':
|
||||||
|
|||||||
@@ -205,7 +205,9 @@ def find_license_files(d):
|
|||||||
|
|
||||||
for url in lic_files.split():
|
for url in lic_files.split():
|
||||||
try:
|
try:
|
||||||
(type, host, path, user, pswd, parm) = bb.fetch.decodeurl(url)
|
(method, host, path, user, pswd, parm) = bb.fetch.decodeurl(url)
|
||||||
|
if method != "file" or not path:
|
||||||
|
raise bb.fetch.MalformedUrl()
|
||||||
except bb.fetch.MalformedUrl:
|
except bb.fetch.MalformedUrl:
|
||||||
bb.fatal("%s: LIC_FILES_CHKSUM contains an invalid URL: %s" % (d.getVar('PF'), url))
|
bb.fatal("%s: LIC_FILES_CHKSUM contains an invalid URL: %s" % (d.getVar('PF'), url))
|
||||||
# We want the license filename and path
|
# We want the license filename and path
|
||||||
|
|||||||
Reference in New Issue
Block a user