diff options
author | Raphael Geissert <geissert@debian.org> | 2013-03-10 19:48:34 +0000 |
---|---|---|
committer | Raphael Geissert <geissert@debian.org> | 2013-03-10 19:48:34 +0000 |
commit | af63bc8338964356eae0266e902a06f1b057a89a (patch) | |
tree | 858085b7a8103e67a14ed834493b2b98a1f902fe /bin/gen-DSA | |
parent | 1536747c5b33f8ecd8874155adabe5cd04ee31c2 (diff) |
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
Diffstat (limited to 'bin/gen-DSA')
-rwxr-xr-x | bin/gen-DSA | 28 |
1 files changed, 24 insertions, 4 deletions
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= |