From 354aaeb06a73a9a05974a6b9b4ecd84b2c0b4446 Mon Sep 17 00:00:00 2001 From: Florian Weimer Date: Thu, 20 Oct 2005 09:03:39 +0000 Subject: r638@deneb: fw | 2005-10-14 15:43:12 +0200 bin/tracker_service.py (TrackerService.page_home): Document external interfaces. (TrackerService.page_bug): Add NVD references. (TrackerService.page_status_release_stable, TrackerService.page_status_release_testing): Show NVD remote attack range if present. (TrackerService.url_nvd, TrackerService.make_nvd_ref): New. lib/python/security_db.py (NVDEntry): New class. (DB.initSchema): New nvd_data table. Update stable_status and testing_status views. (DB.replaceNVD, DB.getNVD): New methods. bin/update-nvd, lib/python/nvd.py: New files. git-svn-id: svn+ssh://svn.debian.org/svn/secure-testing@2488 e39458fd-73e7-0310-bf30-c45bca0a0e42 --- bin/update-nvd | 35 +++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100644 bin/update-nvd (limited to 'bin/update-nvd') diff --git a/bin/update-nvd b/bin/update-nvd new file mode 100644 index 0000000000..4910845ef9 --- /dev/null +++ b/bin/update-nvd @@ -0,0 +1,35 @@ +#!/usr/bin/python + +import os +import os.path +import string +import sys + +def setup_paths(): + check_file = 'lib/python/debian_support.py' + path = os.getcwd() + while 1: + if os.path.exists("%s/%s" % (path, check_file)): + sys.path = [path + '/lib/python'] + sys.path + return path + idx = string.rfind(path, '/') + if idx == -1: + raise ImportError, "could not setup paths" + path = path[0:idx] +os.chdir(setup_paths()) + +import nvd +import security_db + +db_file = 'data/security.db' +db = security_db.DB(db_file) + +data = [] +for name in sys.argv[1:]: + f = file(name) + data += nvd.parse(f) + f.close() + +cursor = db.writeTxn() +db.replaceNVD(cursor, data) +db.commit(cursor) -- cgit v1.2.3