summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBjoern Tropf <asymmail@googlemail.com>2009-06-13 15:46:09 +0200
committerBjoern Tropf <asymmail@googlemail.com>2009-06-13 15:46:09 +0200
commit9460d78804fc85e016bd92555845a4de59e5391d (patch)
tree7eec59160ecaf4ffefd42950ad1efd19fb7c8038
parentImplement read_cve_file() (diff)
downloadkernel-check-9460d78804fc85e016bd92555845a4de59e5391d.tar.gz
kernel-check-9460d78804fc85e016bd92555845a4de59e5391d.tar.bz2
kernel-check-9460d78804fc85e016bd92555845a4de59e5391d.zip
Rename bug -> bugroot, vul.interval -> vul.affected
-rwxr-xr-xkernellib.py18
1 files changed, 9 insertions, 9 deletions
diff --git a/kernellib.py b/kernellib.py
index 7ab29a4..5815f2d 100755
--- a/kernellib.py
+++ b/kernellib.py
@@ -153,7 +153,7 @@ class Vulnerability:
bugid = int()
cvelist = list()
cves = list()
- interval = list()
+ affected = list()
reported = str()
reporter = str()
@@ -352,7 +352,7 @@ def parse_bugzilla_dict(directory, bugid):
error('Invalid cve for bugid [%s]' % root.find('bug_id').text)
error('-> %s' % root.find('short_desc').text)
- vul.interval = from_whiteboard(root.find('status_whiteboard').text)
+ vul.affected = from_whiteboard(root.find('status_whiteboard').text)
#TODO Error
vul.arch = root.find('rep_platform').text
@@ -463,13 +463,13 @@ def read_cve_file(directory, bugid):
memory_map = mmap.mmap(xml_data.fileno(), 0)
root = et.parse(memory_map).getroot()
- bug = root.find('bug')
+ bugroot = root.find('bug')
- vul = Vulnerability(bug.find('bugid').text)
- vul.arch = bug.find('arch').text
+ vul = Vulnerability(bugroot.find('bugid').text)
+ vul.arch = bugroot.find('arch').text
#vul.interval = from_xml()
- vul.reported = bug.find('reported').text
- vul.reporter = bug.find('reporter').text
+ vul.reported = bugroot.find('reported').text
+ vul.reporter = bugroot.find('reporter').text
cves = list()
@@ -500,8 +500,8 @@ def write_cve_file(directory, vul):
for element in BUGORDER:
if element == 'affected':
affectedroot = et.SubElement(bugroot, 'affected')
- if vul.interval:
- for item in vul.interval:
+ if vul.affected:
+ for item in vul.affected:
item.to_xml(affectedroot)
else:
error('Whiteboard for bugid [%s]' % vul.bugid)