Author: fw
Date: 2005-09-21 06:38:05 +0000 (Wed, 21 Sep 2005)
New Revision: 2063

Modified:
   lib/python/security_db.py
Log:
lib/python/security_db.py (DB._calcUnstable):
  Distinguish between "not vulnerable" (we have a fixed version) and
 "not known to be vulnerable" (no matching version annotation).


Modified: lib/python/security_db.py
===================================================================
--- lib/python/security_db.py   2005-09-21 06:08:51 UTC (rev 2062)
+++ lib/python/security_db.py   2005-09-21 06:38:05 UTC (rev 2063)
@@ -1039,17 +1039,20 @@
         """Update bug_status with bug_name for unstable."""
         
         vulnerable_packages = []
-        for (package,) in cursor.execute(
-            """SELECT DISTINCT sp.name
+        have_something = False
+        for (package, vulnerable) in cursor.execute(
+            """SELECT DISTINCT sp.name, st.vulnerable
             FROM package_notes AS n,
             source_package_status AS st, source_packages AS sp
             WHERE n.bug_name = ? AND n.urgency <> 'unimportant'
             AND n.release = ''
-            AND st.note = n.id AND st.vulnerable
+            AND st.note = n.id
             AND sp.rowid = st.package AND sp.release = 'sid'
             ORDER BY sp.name""",
             (bug_name,)):
-            vulnerable_packages.append(package)
+            have_something = True
+            if vulnerable:
+                vulnerable_packages.append(package)
 
         if vulnerable_packages:
             if len(vulnerable_packages) == 1:
@@ -1062,11 +1065,14 @@
                 VALUES (?, 'unstable', 'vulnerable', ?)""",
                       (bug_name, pkgs))
         else:
+            if have_something:
+                status = "not vulnerable"
+            else:
+                status = "not known to be vulnerable"
             cursor.execute("""INSERT INTO bug_status
                 (bug_name, release, status, reason)
-                VALUES (?, 'unstable', 'fixed',
-                'not known to be vulnerable')""",
-                      (bug_name,))
+                VALUES (?, 'unstable', 'fixed', ?)""",
+                      (bug_name, status))
 
     def _calcTesting(self, cursor, bug_name):
         """Update bug_status with bug_name for unstable."""


_______________________________________________
Secure-testing-commits mailing list
Secure-testing-commits@lists.alioth.debian.org
http://lists.alioth.debian.org/mailman/listinfo/secure-testing-commits

Reply via email to