#!/bin/bash #################### # Copyright (C) 2010 by Raphael Geissert # # # This file is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # This file is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this file. If not, see . #################### set -e regex= after= while [ $# -ge 1 ]; do case $1 in --after|-a) [ $# -gt 1 ] || { echo "Missing argument for --after" >&2 exit 1 } shift after="$1" ;; --help|-h) echo "Usage: $(basename "$0") [--after|-a per-year-id] [regex]" echo ; echo "Look for NFUs in our tracker but recognised by RH (for now)" echo "(requires you to run ./update.sh every now and then)" echo ; year="$(date +%Y)" echo "Example (check ids of $year):" echo -e "\t$(basename "$0") CVE-$year" echo "Example (check ids after CVE-$year-0100):" echo -e "\t$(basename "$0") --after 0100 CVE-$year" echo ; echo "Note: this is a hackish and slow implementation." exit ;; *) regex="$1" ;; esac shift done for cve in $(< cve.list); do if [[ $regex ]]; then [[ $cve =~ $regex ]] || continue fi if [[ $after ]]; then [ "${cve#CVE-*-}" '>' "$after" ] || continue fi # Permanent exclusions can be added below o=$(grep -m1 -A1 $cve ../data/CVE/list | grep NOT-FOR-US | grep -vi redhat | grep -vi 'red hat' | grep -vi pre-dating | grep -vi realplayer | grep -vi acroread | grep -vi acrobat | grep -vi adobe | grep -vi 'real player') && echo "$cve: $o" || : done