Skip to contentSkip to conversation

cve-check.bbclass: don't skip scanning if file not found

PATCH In review akuster 2 participants 3 messages Feb 15, 2021 – Feb 18, 2021

lore
Share & tools
lore

akuster

author
#0 lore raw

PATCH 1/1 cve-check.bbclass: don't skip scanning if file not found

This helps avoid these errors:
ERROR: lockdev-1_1.0.3-r0 do_cve_check: File Not found: /home/build/builds/master/tmp/work/core2-64-poky-linux/lockdev/1_1.0.3-r0/lockdev_1.0.3-1.6.diff

We should continuing to scan other applied patches for CVE info.

---
 meta/classes/cve-check.bbclass | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
meta/classes/cve-check.bbclass +2 -2
index 1bed815d8e4..e56366579d1 100644
@@ -186,8 +186,8 @@ def get_patches_cves(d):
         patch_file = bb.fetch.decodeurl(url)[2]
 
         if not os.path.isfile(patch_file):
-            bb.error("File Not found: %s" % patch_file)
-            raise FileNotFoundError
+            bb.warn("File Not found: %s" % patch_file)
+            continue
 
         # Check patch file name for CVE ID
         fname_match = cve_file_name_match.search(patch_file)
Signature · 1 line
2.25.1
#1 lore raw

Why is the file not found though?

Ross

Quoted 32 lines · akuster

This helps avoid these errors:
ERROR: lockdev-1_1.0.3-r0 do_cve_check: File Not found: /home/build/builds/master/tmp/work/core2-64-poky-linux/lockdev/1_1.0.3-r0/lockdev_1.0.3-1.6.diff

We should continuing to scan other applied patches for CVE info.

---
 meta/classes/cve-check.bbclass | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
meta/classes/cve-check.bbclass +2 -3
index 1bed815d8e4..e56366579d1 100644
@@ -186,8 +186,8 @@ def get_patches_cves(d):
         patch_file = bb.fetch.decodeurl(url)[2]
 
         if not os.path.isfile(patch_file):
-            bb.error("File Not found: %s" % patch_file)
-            raise FileNotFoundError
+            bb.warn("File Not found: %s" % patch_file)
+            continue
 
         # Check patch file name for CVE ID
         fname_match = cve_file_name_match.search(patch_file)
--

2.25.1

author
#2 lore raw
Quoted 1 line · Ross Burton

Why is the file not found though?

its downloaded there for not in the WORKDIR

-armin

Quoted 35 lines

Ross

Quoted 31 lines · akuster

This helps avoid these errors:
ERROR: lockdev-1_1.0.3-r0 do_cve_check: File Not found: /home/build/builds/master/tmp/work/core2-64-poky-linux/lockdev/1_1.0.3-r0/lockdev_1.0.3-1.6.diff

We should continuing to scan other applied patches for CVE info.

---
 meta/classes/cve-check.bbclass | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
meta/classes/cve-check.bbclass +2 -3
index 1bed815d8e4..e56366579d1 100644
@@ -186,8 +186,8 @@ def get_patches_cves(d):
         patch_file = bb.fetch.decodeurl(url)[2]
 
         if not os.path.isfile(patch_file):
-            bb.error("File Not found: %s" % patch_file)
-            raise FileNotFoundError
+            bb.warn("File Not found: %s" % patch_file)
+            continue
 
         # Check patch file name for CVE ID
         fname_match = cve_file_name_match.search(patch_file)
--

2.25.1