[Secure-testing-commits] r6654 - bin

nion at alioth.debian.org nion at alioth.debian.org
Thu Sep 20 18:14:54 UTC 2007


Author: nion
Date: 2007-09-20 18:14:54 +0000 (Thu, 20 Sep 2007)
New Revision: 6654

Added:
   bin/get-bug-status
   bin/get-todo-items
Log:
get-todo-items returns cve, package name, bug and bug status for a given unfixed issue, get-bug-status is used to get the status via soap


Added: bin/get-bug-status
===================================================================
--- bin/get-bug-status	                        (rev 0)
+++ bin/get-bug-status	2007-09-20 18:14:54 UTC (rev 6654)
@@ -0,0 +1,29 @@
+#!/usr/bin/ruby
+require 'soap/rpc/driver'
+# Nico Golde <nion at debian.org>
+# Latest change: Do Sep 20 20:13:27 CEST 2007
+# return fixed version or TODO: fix for given bug
+
+bug = ARGV[0].to_i
+host = "bugs.debian.org"
+port = 80
+server="http://#{host}:#{port}/cgi-bin/soap.cgi"
+ns = 'Debbugs/SOAP/'
+drv = SOAP::RPC::Driver.new(server, ns) 
+drv.add_method('get_status','bugnumber')
+
+response = drv.get_status(bug)
+
+if response[bug] == nil then
+    puts "bug not found"
+    exit
+end
+
+fix = response[bug].fixed_versions[0].to_s
+
+if fix == nil or fix == "" then
+    puts "TODO: fix"
+else
+    puts "TODO: mark as fixed in " + fix
+end
+


Property changes on: bin/get-bug-status
___________________________________________________________________
Name: svn:executable
   + *

Added: bin/get-todo-items
===================================================================
--- bin/get-todo-items	                        (rev 0)
+++ bin/get-todo-items	2007-09-20 18:14:54 UTC (rev 6654)
@@ -0,0 +1,47 @@
+#!/bin/sh
+# Nico Golde <nion at debian.org>
+# Latest change: Do Sep 20 20:13:19 CEST 2007
+# extract TODO items for unfixed security issues in unstable/testing
+
+DATA="../data/CVE/list"
+TMP="list.tmp"
+
+:> $TMP
+
+awk "BEGIN { RS = \"CVE-\" } /<unfixed>/" $DATA > $TMP
+
+while read LINE; do
+
+    case "$LINE" in
+    *\-*\ \(*...\))
+        CVE="CVE-$( echo "$LINE" | cut -d ' ' -f 1 )"
+        ;;
+    *NOTE:*) ;;
+    *\[etch\]*) ;;
+    *\[sarge\]*) ;;
+    *\<unfixed\>*)
+        # output unimportant issues with -v
+        if [ ! "$1" = "-v" ]; then
+            STATUS="$( echo "$LINE" | grep -e '(*unimportant)*' )"
+            if [ "x$STATUS" = "x$LINE" ]; then
+                continue
+            fi
+        fi
+
+        PKG="$( echo "$LINE" | sed -e 's/.*- \(.\+\)\ <unfixed>.*/\1/' )"
+        BUG="$( echo "$LINE" | sed -e 's/.*bug\ #\([0-9]\+\).*/\1/' )"
+
+        if [ "x$BUG" = "x" -o "x$BUG" = "x$LINE" ]; then
+            TODO="TODO: report bug"
+            echo "$CVE" "$PKG" "$TODO"
+        else
+            TODO="$( ./get-bug-status "$BUG" )"
+            echo "$CVE" "$PKG" "$BUG" "$TODO"
+        fi
+        ;;
+    *) ;;
+    esac
+
+done < $TMP
+
+rm -f $TMP


Property changes on: bin/get-todo-items
___________________________________________________________________
Name: svn:executable
   + *




More information about the Secure-testing-commits mailing list