]> code.ossystems Code Review - openembedded-core.git/commitdiff
classes: sanity-check LIC_FILES_CHKSUM
authorRoss Burton <ross.burton@intel.com>
Mon, 13 Aug 2018 17:20:54 +0000 (18:20 +0100)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Thu, 30 Aug 2018 14:57:05 +0000 (15:57 +0100)
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>
Signed-off-by: Armin Kuster <akuster808@gmail.com>
meta/classes/base.bbclass
meta/classes/license.bbclass

index bd0d6e3ca60c561006431d04384e464b47e8dae7..3014767b8ad9fb2a811962d89086b3d8fba336e1 100644 (file)
@@ -100,8 +100,8 @@ def get_lic_checksum_file_list(d):
         # We only care about items that are absolute paths since
         # any others should be covered by SRC_URI.
         try:
-            path = bb.fetch.decodeurl(url)[2]
-            if not path:
+            (method, host, path, user, pswd, parm) = bb.fetch.decodeurl(url)
+            if method != "file" or not path:
                 raise bb.fetch.MalformedUrl(url)
 
             if path[0] == '/':
index d353110464818036cc0550849a3425ba2f00edd6..82fab9c63bdcbd08c2c8f749be6f08e1b4546942 100644 (file)
@@ -482,7 +482,9 @@ def find_license_files(d):
 
     for url in lic_files.split():
         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:
             bb.fatal("%s: LIC_FILES_CHKSUM contains an invalid URL:  %s" % (d.getVar('PF'), url))
         # We want the license filename and path