[Secure-testing-commits] r21567 - bin

Raphael Geissert geissert at alioth.debian.org
Sun Mar 10 19:48:34 UTC 2013


Author: geissert
Date: 2013-03-10 19:48:34 +0000 (Sun, 10 Mar 2013)
New Revision: 21567

Modified:
   bin/gen-DSA
Log:
Allow CVE ids and bug numbers to be passed in any order

No need of passing them as a list in a single argument.


Modified: bin/gen-DSA
===================================================================
--- bin/gen-DSA	2013-03-10 15:06:21 UTC (rev 21566)
+++ bin/gen-DSA	2013-03-10 19:48:34 UTC (rev 21567)
@@ -32,9 +32,11 @@
 }
 
 [ $# -ge 2 ] || {
-    echo "usage: $0 [--save] [DSA] package 'vulnerability desc' [cve(s) [bugnumber]]"
+    echo "usage: $0 [--save] [DSA] package 'vulnerability desc' [cve(s) [bugnumber(s)]]"
     echo "       'DSA' is the DSA number, required when issuing a revision"
-    echo "       'cve(s)' must be a space separated list in one arg"
+    echo "       'cve(s)' and 'bugnumber(s)' can be passed in any order but"
+    echo "         always AFTER the description"
+    echo "       If it doesn't like your bug number, prefix it with # and report"
     exit 1
 } >&2
 
@@ -149,11 +151,29 @@
 
 PACKAGE="$(tolower "$1")"
 VULNERABILITY="$(cleanup_vulnerability "$2")"
-CVE="$(toupper "$3")"
-BUGNUM="${4#\#}"
+shift 2
+
+CVE=
+BUGNUM=
 REFERENCES=0
 TEXT=
 
+while [ $# -gt 0 ]; do
+    case "$1" in
+	[cC][vV][eE]-*)
+	    CVE="$CVE $(toupper "$1")"
+	;;
+	[0-9][0-9][0-9][0-9][0-9][0-9]|[#][0-9]*)
+	    BUGNUM="$BUGNUM ${1#\#}"
+	;;
+	*)
+	    error "Don't know what to do with '$1' argument" >&2
+	    exit 1
+	;;
+    esac
+    shift
+done
+
 CVE="$(split_n_sort "$CVE")"
 cve_spacing=
 




More information about the Secure-testing-commits mailing list