summaryrefslogtreecommitdiffstats
path: root/bin/report-vuln
diff options
context:
space:
mode:
authorNico Golde <nion@debian.org>2008-06-07 09:12:39 +0000
committerNico Golde <nion@debian.org>2008-06-07 09:12:39 +0000
commita20b9caf6df0a73adb962d258854df4fb580b693 (patch)
treea49160f11575c6a3a6a32d6ec7958c1ac22f9d23 /bin/report-vuln
parent74b35af9d0cfb575dccc39af5636d264dfe80f7c (diff)
use urllib instead of httplib as it takes care of http_proxy by itself
git-svn-id: svn+ssh://svn.debian.org/svn/secure-testing@9011 e39458fd-73e7-0310-bf30-c45bca0a0e42
Diffstat (limited to 'bin/report-vuln')
-rwxr-xr-xbin/report-vuln28
1 files changed, 10 insertions, 18 deletions
diff --git a/bin/report-vuln b/bin/report-vuln
index 08d5e0a7d9..3e495667f4 100755
--- a/bin/report-vuln
+++ b/bin/report-vuln
@@ -13,7 +13,7 @@
# }
# export http_proxy if you need to use an http proxy to report bugs
-import sys, re, httplib, os
+import sys, re, urllib, os
def gen_index(ids):
ret = ''
@@ -23,24 +23,16 @@ def gen_index(ids):
return ret
-def do_httpconnect(id):
- proxy = os.getenv('http_proxy')
- if proxy:
- if proxy.lower().startswith('http://'):
- proxy = proxy.replace('http://', '')
-
- url = '/cgi-bin/cvename.cgi?name=' + id
- host = 'cve.mitre.org'
- if proxy != None:
- host = proxy
- url = 'http://cve.mitre.org' + url
-
+def http_get(id):
+ param = urllib.urlencode({'name' : id})
+ resp = ''
try:
- conn = httplib.HTTPConnection(host)
- conn.request('GET', url)
- resp = conn.getresponse()
+ f = urllib.urlopen('http://cve.mitre.org/cgi-bin/cvename.cgi?%s' % param)
+ resp = f.read()
except Exception, e:
error('on doing HTTP request' + str(e))
+
+ f.close()
return resp
@@ -50,9 +42,9 @@ def get_cve(id):
r = re.compile('.*<th\ colspan=.*>Description<.*')
tag = re.compile('.*</?tr>.*')
ret = ''
- resp = do_httpconnect(id)
+ resp = http_get(id)
- for line in resp.read().rsplit('\n'):
+ for line in resp.rsplit('\n'):
if r.match(line):
desc = True
continue

© 2014-2024 Faster IT GmbH | imprint | privacy policy