[Secure-testing-commits] r19982 - bin

Raphael Geissert geissert at alioth.debian.org
Mon Aug 20 00:24:03 UTC 2012


Author: geissert
Date: 2012-08-20 00:24:02 +0000 (Mon, 20 Aug 2012)
New Revision: 19982

Modified:
   bin/report-vuln
Log:
Use the temporary description if the id is still RESERVED


Modified: bin/report-vuln
===================================================================
--- bin/report-vuln	2012-08-19 23:56:58 UTC (rev 19981)
+++ bin/report-vuln	2012-08-20 00:24:02 UTC (rev 19982)
@@ -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 @@
 	desc = False
 	r = re.compile('.*<th\ colspan=.*>Description<.*')
 	tag = re.compile('.*</?tr>.*')
+	reserved = re.compile(r'\*+\s+RESERVED\s+\*+')
 	ret = ''
 	resp = http_get(id)
 
@@ -49,6 +64,9 @@
 			desc = True
 			continue
 
+		if desc and reserved.search(line):
+			break
+
 		if tag.match(line) and desc:
 			continue
 
@@ -62,6 +80,12 @@
 		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):




More information about the Secure-testing-commits mailing list