From af63bc8338964356eae0266e902a06f1b057a89a Mon Sep 17 00:00:00 2001 From: Raphael Geissert Date: Sun, 10 Mar 2013 19:48:34 +0000 Subject: Allow CVE ids and bug numbers to be passed in any order No need of passing them as a list in a single argument. git-svn-id: svn+ssh://svn.debian.org/svn/secure-testing@21567 e39458fd-73e7-0310-bf30-c45bca0a0e42 --- bin/gen-DSA | 28 ++++++++++++++++++++++++---- 1 file changed, 24 insertions(+), 4 deletions(-) (limited to 'bin/gen-DSA') diff --git a/bin/gen-DSA b/bin/gen-DSA index 487b5fd0e7..794e3fdd52 100755 --- a/bin/gen-DSA +++ b/bin/gen-DSA @@ -32,9 +32,11 @@ export LANG=C } [ $# -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 @@ fi 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= -- cgit v1.2.3