[oe-commits] [openembedded-core] 04/53: classes: sanity-check LIC_FILES_CHKSUM

git at git.openembedded.org git at git.openembedded.org
Wed Aug 29 14:24:24 UTC 2018


This is an automated email from the git hooks/post-receive script.

rpurdie pushed a commit to branch sumo
in repository openembedded-core.

commit a5db618986746bf9082c4b3cbdac4e523328432e
Author: Ross Burton <ross.burton at intel.com>
AuthorDate: Mon Aug 13 18:20:54 2018 +0100

    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 at intel.com>
    Signed-off-by: Richard Purdie <richard.purdie at linuxfoundation.org>
    Signed-off-by: Armin Kuster <akuster808 at gmail.com>
---
 meta/classes/base.bbclass    | 4 ++--
 meta/classes/license.bbclass | 4 +++-
 2 files changed, 5 insertions(+), 3 deletions(-)

diff --git a/meta/classes/base.bbclass b/meta/classes/base.bbclass
index bb1f4b7..abb4ead 100644
--- a/meta/classes/base.bbclass
+++ b/meta/classes/base.bbclass
@@ -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] == '/':
diff --git a/meta/classes/license.bbclass b/meta/classes/license.bbclass
index 06dd4a8..5103ed8 100644
--- a/meta/classes/license.bbclass
+++ b/meta/classes/license.bbclass
@@ -480,7 +480,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

-- 
To stop receiving notification emails like this one, please contact
the administrator of this repository.


More information about the Openembedded-commits mailing list