From b285eb313c795f8d65bafc0d37c385dde460bfc3 Mon Sep 17 00:00:00 2001 From: Raphael Geissert Date: Mon, 20 Aug 2012 00:24:02 +0000 Subject: Use the temporary description if the id is still RESERVED git-svn-id: svn+ssh://svn.debian.org/svn/secure-testing@19982 e39458fd-73e7-0310-bf30-c45bca0a0e42 --- bin/report-vuln | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) (limited to 'bin/report-vuln') diff --git a/bin/report-vuln b/bin/report-vuln index 5164c88edc..e7fea38daa 100755 --- a/bin/report-vuln +++ b/bin/report-vuln @@ -15,6 +15,20 @@ import sys, re, urllib, os +def setup_path(): + dirname = os.path.dirname + base = dirname(dirname(os.path.realpath(sys.argv[0]))) + sys.path.insert(0, os.path.join(base, "lib", "python")) + +def description_from_list(id): + setup_path() + import bugs + import debian_support + for bug in bugs.CVEFile(debian_support.findresource( + *"data CVE list".split())): + if bug.name == id: + return bug.description + def gen_index(ids): ret = '' for cnt, id in enumerate(ids): @@ -41,6 +55,7 @@ def get_cve(id): desc = False r = re.compile('.*Description<.*') tag = re.compile('.*.*') + reserved = re.compile(r'\*+\s+RESERVED\s+\*+') ret = '' resp = http_get(id) @@ -49,6 +64,9 @@ def get_cve(id): desc = True continue + if desc and reserved.search(line): + break + if tag.match(line) and desc: continue @@ -62,6 +80,12 @@ def get_cve(id): if desc and line != '': ret = ret + '\n| ' + line + if ret == '': + ret = description_from_list(id) + + if ret == '': + ret = 'No description was found (try on a search engine)' + return ret + '\n' def gen_text(pkg, cveid): -- cgit v1.2.3