summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xpym/kernelcheck/kernelcheck.py13
-rw-r--r--pym/kernelcheck/lib/kernellib.py14
2 files changed, 22 insertions, 5 deletions
diff --git a/pym/kernelcheck/kernelcheck.py b/pym/kernelcheck/kernelcheck.py
index 3f066cb..6271f5f 100755
--- a/pym/kernelcheck/kernelcheck.py
+++ b/pym/kernelcheck/kernelcheck.py
@@ -186,13 +186,24 @@ def print_summary(vullist, kernel_updates):
if 'A:P' in cve.vector or 'A:C' in cve.vector:
cvetype += '%s%s' % (' ', blue('-availability'))
+ #TODO add pending identifier
+ if ' PENDING ' in cve.desc and '0000-00-00' == cve.published:
+ cvetype = '(%s%%)' % colorize('WARN', 'pending')
+
+ if 'GENERIC-MAP-NOMATCH' == cve.cve:
+ cve.cve = 'CVE-0000-0000'
+ cvetype = '(%s%%)' % colorize('WARN', 'nomatch')
+
+ if cve.score == '10.0':
+ cve.score = '10.'
+
index = str()
if repr(item.fixed) in kernel_updates:
index = teal('[%s]' % kernel_updates[repr(item.fixed)])
print('[%s %26s] %s %s TYPE="%s" %s') % (darkgreen('bugid'),
colorize('GOOD', item.bugid), darkgreen(cve.cve),
- blue('[%4s]' % cve.score), cvetype, index)
+ blue('[%3s]' % cve.score), cvetype, index)
def print_bug(bugid):
diff --git a/pym/kernelcheck/lib/kernellib.py b/pym/kernelcheck/lib/kernellib.py
index e593d02..9ad1a55 100644
--- a/pym/kernelcheck/lib/kernellib.py
+++ b/pym/kernelcheck/lib/kernellib.py
@@ -398,13 +398,16 @@ def extract_genpatch(ebuild, directory, sources):
return genpatch
-def parse_cve_files(directory):
+def parse_cve_files(directory, spinner=None):
'Returns all bug files as list'
files = list()
if (os.path.exists(directory)):
for item in os.listdir(directory):
+ if spinner:
+ spinner.update()
+
try:
cve_file = read_cve_file(directory, item)
if cve_file is not None:
@@ -430,7 +433,7 @@ def find_cve(cve, directory):
def eval_cve_files(directory, kernel, spinner=None):
'Returns a vulnerabilty evaluation'
- files = parse_cve_files(directory)
+ files = parse_cve_files(directory, spinner)
if not files:
return None
@@ -627,7 +630,7 @@ def extract_version(release):
return kernel
-def all_version(source):
+def all_version(source, spinner=None):
""" Given a kernel source name (e.g. vanilla), returns a Kernel object
for the latest revision in the tree, or None if none exists. """
@@ -638,6 +641,9 @@ def all_version(source):
'sys-kernel/%s-sources' % source)
for item in matches:
+ if spinner:
+ spinner.update()
+
best = portage.versions.catpkgsplit(item)
if not best:
continue
@@ -657,7 +663,7 @@ def eval_kernel_updates(kernel, kernel_eval, spinner):
index = 0
kernel_dict = dict()
- for compare in all_version(kernel.source):
+ for compare in all_version(kernel.source, spinner):
if compare.version > kernel.version or \
(compare.version == kernel.version and \
compare.revision > kernel.revision):