diff options
author | Carles Pina i Estany <carles@pina.cat> | 2021-02-15 09:14:47 +0000 |
---|---|---|
committer | Sebastien Delafond <seb@debian.org> | 2021-02-15 09:14:47 +0000 |
commit | ee615967842797c7d9fe74f87d9e01ef05d838d7 (patch) | |
tree | fbcbaff89fcc62f99fca54bfa838248763bd178c /bin/tracker_data.py | |
parent | cd86bbc50fdb1d83588e5cc04ecd25c494e901c0 (diff) |
Fix CVE10k problem for CVE with more than 4 numbers
It had no consequences in security-tracker: the
next-oldstable-point-update.txt file is empty and the
next-point-update.txt CVEs are not used yet for what I can see via this
code path.
Diffstat (limited to 'bin/tracker_data.py')
-rw-r--r-- | bin/tracker_data.py | 22 |
1 files changed, 3 insertions, 19 deletions
diff --git a/bin/tracker_data.py b/bin/tracker_data.py index f0bbb0de70..15d173ad6e 100644 --- a/bin/tracker_data.py +++ b/bin/tracker_data.py @@ -20,6 +20,7 @@ import subprocess import requests import six +from debian_support import PointUpdateParser class TrackerData(object): @@ -125,26 +126,9 @@ class TrackerData(object): with open(os.path.join(self.DATA_DIR, 'dla-needed.txt'), 'r') as f: self.dla_needed = self.parse_needed_file(f) - @classmethod - def parse_point_update_file(self, inputfile): - CVE_RE = 'CVE-[0-9]{4}-[0-9X]{4}' - result = {} - for line in inputfile: - res = re.match(CVE_RE, line) - if res: - cve = res.group(0) - result[cve] = {} - continue - elif line.startswith('\t['): - dist, _, pkg, ver = line.split() - result[cve][pkg] = ver - return result - def load_point_updates(self): - with open(os.path.join(self.DATA_DIR, 'next-oldstable-point-update.txt'), 'r') as f: - self.oldstable_point_update = self.parse_point_update_file(f) - with open(os.path.join(self.DATA_DIR, 'next-point-update.txt'), 'r') as f: - self.stable_point_update = self.parse_point_update_file(f) + self.oldstable_point_update = PointUpdateParser.parseNextOldstablePointUpdate() + self.stable_point_update = PointUpdateParser.parseNextPointUpdateStable() def iterate_packages(self): """Iterate over known packages""" |