diff options
author | Raphael Geissert <atomo64@gmail.com> | 2014-02-12 14:23:23 +0000 |
---|---|---|
committer | Raphael Geissert <atomo64@gmail.com> | 2014-02-12 14:23:23 +0000 |
commit | 8b8a55f40fcb4d9fdfe10fd7154a55d98491797c (patch) | |
tree | a6d1d7bb498a585b0175721aa5e22eeb4bf00519 /bin/reserved-but-public | |
parent | e845943b7621dfdc9d9cb84c085a9f6add8cc500 (diff) |
allow taking a filter to restrict the output to CVE ids matching it
E.g.
bin/reserved-but-public 2010-*
bin/reserved-but-public 201[12]-*
git-svn-id: svn+ssh://svn.debian.org/svn/secure-testing@25697 e39458fd-73e7-0310-bf30-c45bca0a0e42
Diffstat (limited to 'bin/reserved-but-public')
-rwxr-xr-x | bin/reserved-but-public | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/bin/reserved-but-public b/bin/reserved-but-public index 570df6dabf..20f04619fb 100755 --- a/bin/reserved-but-public +++ b/bin/reserved-but-public @@ -30,21 +30,34 @@ list=data/CVE/list verbose=false if [ "${1:-}" = "--verbose" ]; then verbose=true + shift +fi + +regex='*' +if [ -n "${1:-}" ]; then + regex="${1:-}" fi reserved=false +wanted=false cve= while read line; do case $line in + CVE-$regex) + cve="$line" + reserved=false + wanted=true + ;; CVE-*) cve="$line" reserved=false + wanted=false ;; *RESERVED) reserved=true ;; *) - if ! $reserved; then + if ! $reserved || ! $wanted; then continue fi if [ "$cve" ]; then |