diff options
Diffstat (limited to 'pym/kernelcheck/lib/kernellib.py')
-rw-r--r-- | pym/kernelcheck/lib/kernellib.py | 30 |
1 files changed, 12 insertions, 18 deletions
diff --git a/pym/kernelcheck/lib/kernellib.py b/pym/kernelcheck/lib/kernellib.py index c95252e..f9ec9c5 100644 --- a/pym/kernelcheck/lib/kernellib.py +++ b/pym/kernelcheck/lib/kernellib.py @@ -1,6 +1,6 @@ #!/usr/bin/env python # kernel-check -- Gentoo Kernel Security -# Copyright 2009-2009 Gentoo Foundation +# Copyright 2009-2010 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 import inspect @@ -44,14 +44,8 @@ KERNEL_TYPES = [ VERSION = '0.3.15' DEBUG = False -FILEPATH = os.path.dirname(os.path.realpath(__file__)) PORTDIR = portage.settings['PORTDIR'] -DIR = { - 'tmp' : os.path.join(FILEPATH, 'tmp'), - 'out' : os.path.join(PORTDIR, 'metadata', 'kernel'), - 'bug' : os.path.join(FILEPATH, 'tmp', 'bug'), - 'nvd' : os.path.join(FILEPATH, 'tmp', 'nvd') -} +KERNELDIR = os.path.join(PORTDIR, 'metadata', 'kernel') def BUG_ON(msg, e): if DEBUG: @@ -317,10 +311,10 @@ def is_in_interval(interval, kernel, bugid=None): version = kernel.version.replace('-', '.') elif interval.name == 'hardened': - version = kernel.version #TODO is this correct? + version = kernel.version #TODO implement elif interval.name == 'xen': - version = kernel.version #TODO is this correct? + version = kernel.version #TODO implement elif interval.name == 'vserver': return False @@ -426,7 +420,7 @@ def find_cve(cve, directory): return None -def eval_cve_files(directory, kernel, spin=None): +def eval_cve_files(directory, kernel, spinner=None): 'Returns a vulnerabilty evaluation' files = parse_cve_files(directory) @@ -439,8 +433,8 @@ def eval_cve_files(directory, kernel, spin=None): evaluation = Evaluation() for item in files: - if spin: - spin.update() + if spinner: + spinner.update() evaluation.read += 1 if item.arch not in ARCHES: @@ -515,7 +509,7 @@ def is_affected(interval_list, kernel, item): kernel_affected = True else: kernel_affected = False - #TODO Implement else for hardend/xen/expand + #TODO Implement else for hardend and xen return kernel_affected @@ -650,19 +644,19 @@ def all_version(source): return versions -def eval_kernel_updates(kernel, kernel_eval, spin): +def eval_kernel_updates(kernel, kernel_eval, spinner): "" index = 0 kernel_dict = dict() for compare in all_version(kernel.source): - if compare.version > kernel.version or \ - (compare.version == kernel.version and \ + if compare.version > kernel.version or \ + (compare.version == kernel.version and \ compare.revision > kernel.revision): compare.arch = kernel.arch compare.genpatch = get_genpatch(PORTDIR, compare) - compare_eval = eval_cve_files(DIR['out'], compare, spin) + compare_eval = eval_cve_files(DIR['out'], compare, spinner) comparison = compare_evaluation(kernel_eval, compare_eval) for item in comparison.fixed: |