diff options
author | Bjoern Tropf <asymmail@googlemail.com> | 2009-06-08 00:18:55 +0200 |
---|---|---|
committer | Bjoern Tropf <asymmail@googlemail.com> | 2009-06-08 00:18:55 +0200 |
commit | 04992b1af194a5329dab1ed73416bb888c2e0aaa (patch) | |
tree | cd158522ededcbf052a9af1d8129e5c07f0ced21 | |
parent | Add cve/vulnerability class, change lots of code (diff) | |
download | kernel-check-04992b1af194a5329dab1ed73416bb888c2e0aaa.tar.gz kernel-check-04992b1af194a5329dab1ed73416bb888c2e0aaa.tar.bz2 kernel-check-04992b1af194a5329dab1ed73416bb888c2e0aaa.zip |
Fix todo (add gentoo to refs)
-rwxr-xr-x | kernellib.py | 19 |
1 files changed, 8 insertions, 11 deletions
diff --git a/kernellib.py b/kernellib.py index be95a70..da85f7f 100755 --- a/kernellib.py +++ b/kernellib.py @@ -245,9 +245,8 @@ def parse_bugzilla_list(filename): return buglist -#TODO: Short Code, use Vulnerability directly instead of dic def parse_bugzilla_dict(directory, bugid): - 'Returns a vulnerability containing information about a kernel vulnerability' #FIXME: Sounds strange + 'Returns a vulnerability class containing information about a bugzilla bug' bugfilename = os.path.join(directory, bugid) root = et.parse(open(bugfilename, 'r')).getroot()[0] @@ -274,12 +273,17 @@ def parse_bugzilla_dict(directory, bugid): return vul -def search_nvd_dict(dic, vul): #TODO: Rename +def search_nvd_dict(dic, vul): #TODO: Description cves = list() - for item in vul.cvelist: + + bugref = et.SubElement(dic[item]['refs'], 'ref') + bugref.set('url', 'https://bugs.gentoo.org/show_bug.cgi?id=%s' % vul.bugid) + bugref.set('source', 'GENTOO') + bugref.text = 'Gentoo bug %s' % vul.bugid + cve = Cve(item, dic[item]['published'], dic[item]['desc'], @@ -287,8 +291,6 @@ def search_nvd_dict(dic, vul): #TODO: Rename dic[item]['CVSS_vector'], dic[item]['CVSS_score'], dic[item]['refs']) - #TODO: bugref.set('url', 'https://bugs.gentoo.org/show_bug.cgi?id=' + bug_dict['bug_id']) - #TODO: bugref.text = 'Gentoo bug #%s' % (bug_dict['bug_id'],) cves.append(cve) vul.cves = cves @@ -404,12 +406,7 @@ def write_cve_file(directory, vul): for element in cve_order: if element == 'refs': - reftree = cve.refs cveroot.append(cve.refs) - bugref = et.SubElement(reftree, 'ref') #FIXME: Add this information earlier - bugref.set('url', 'https://bugs.gentoo.org/show_bug.cgi?id=%s' % vul.bugid) - bugref.set('source', 'GENTOO') - bugref.text = 'Gentoo bug #%s' % vul.bugid else: node = et.SubElement(cveroot, element) node.text = getattr(cve, element) |