diff options
author | Michael Gilbert <michael.s.gilbert@gmail.com> | 2010-01-03 17:25:10 +0000 |
---|---|---|
committer | Michael Gilbert <michael.s.gilbert@gmail.com> | 2010-01-03 17:25:10 +0000 |
commit | 7bf277781e393f1b0c9e205f099a85a764f1b4b3 (patch) | |
tree | 3d941d4803eaa6701fe2e6ea1a7602be9d7146a7 /lib | |
parent | f50b4093bb9a68cef303168cebac1fa9936dbe75 (diff) |
previous commit is likely insufficient. the problem was that the variable
'status' was being used in two different contexts. using two different
variables now.
git-svn-id: svn+ssh://svn.debian.org/svn/secure-testing@13703 e39458fd-73e7-0310-bf30-c45bca0a0e42
Diffstat (limited to 'lib')
-rw-r--r-- | lib/python/security_db.py | 39 |
1 files changed, 17 insertions, 22 deletions
diff --git a/lib/python/security_db.py b/lib/python/security_db.py index 713062311c..cf203471d1 100644 --- a/lib/python/security_db.py +++ b/lib/python/security_db.py @@ -1203,9 +1203,9 @@ class DB: VALUES (?, 'unstable', ?, ?)""", (bug_name, status, pkgs)) else: if have_something: - status = "not vulnerable" + status = "not vulnerable." else: - status = "not known to be vulnerable" + status = "not known to be vulnerable." cursor.execute("""INSERT INTO bug_status (bug_name, release, status, reason) VALUES (?, 'unstable', 'fixed', ?)""", @@ -1249,19 +1249,15 @@ class DB: unfixed_pkgs.sort() undet_pkgs = undet_pkgs.keys() undet_pkgs.sort() + + pkgs = "" + result = "undetermined" if len(unfixed_pkgs) == 0 and len(undet_pkgs) == 0: if len(status[''].keys()) == 0: - msg = "not known to be vulnerable" + pkgs += "not known to be vulnerable" else: - msg = "not vulnerable" - cursor.execute("""INSERT INTO bug_status - (bug_name, release, status, reason) - VALUES (?, ?, 'fixed', ?)""", - (bug_name, suite, msg)) - return - - pkgs = "" - status = "unknown" + pkgs += "not vulnerable" + result = "fixed" if len(unfixed_pkgs) > 0: if len(unfixed_pkgs) == 1: pkgs += "package " + unfixed_pkgs[0] + " is " @@ -1270,23 +1266,22 @@ class DB: if fixed_in_security: pkgs = "%sfixed in %s-security. " % (pkgs, suite) if suite == "stable": - status = "fixed" + result = "fixed" else: - status = "partially-fixed" + result = "partially-fixed" else: pkgs += "vulnerable. " - status = "vulnerable" - else: - status = "undetermined" - if len(undet_pkgs) == 1: - pkgs += "package " + undet_pkgs[0] + " may be vulnerable but needs to be checked." - else: - pkgs += "packages " + ", ".join(undet_pkgs) + " may be vulnerable but need to be checked." + result = "vulnerable" + if len(undet_pkgs) > 0: + if len(undet_pkgs) == 1: + pkgs += "package " + undet_pkgs[0] + " may be vulnerable but needs to be checked." + else: + pkgs += "packages " + ", ".join(undet_pkgs) + " may be vulnerable but need to be checked." cursor.execute("""INSERT INTO bug_status (bug_name, release, status, reason) VALUES (?, ?, ?, ?)""", - (bug_name, suite, status, pkgs)) + (bug_name, suite, result, pkgs)) def calculateDebsecan0(self, release): """Create data for the debsecan tool (VERSION 0 format).""" |