From c535cd3bbb9c0d6df1b33d8e48e04a85aed3b035 Mon Sep 17 00:00:00 2001 From: Michael Marineau Date: Thu, 19 May 2016 10:20:39 -0700 Subject: [PATCH] glsa-check: simplify and respect current root being tested --- build_library/test_image_content.sh | 17 ++++------------- 1 file changed, 4 insertions(+), 13 deletions(-) diff --git a/build_library/test_image_content.sh b/build_library/test_image_content.sh index 4e52c3931d..2136811941 100644 --- a/build_library/test_image_content.sh +++ b/build_library/test_image_content.sh @@ -2,20 +2,11 @@ # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. -GLSA_WHITELIST=("201412-09") +GLSA_WHITELIST="201412-09" glsa_image() { - VULNS=() - GLSAS=`glsa-check-$BOARD -t all` - for GLSA in $GLSAS; do - if [[ " ${GLSA_WHITELIST[@]} " =~ " ${GLSA} " ]]; then - continue - else - VULNS+=($GLSA) - fi - done - if [[ ${#VULNS[@]} != 0 ]]; then - echo "The following GLSAs apply: $VULNS" + if glsa-check-$BOARD -t all | grep -v "$GLSA_WHITELIST"; then + echo "The above GLSAs apply to $ROOT" return 1 fi @@ -65,7 +56,7 @@ test_image_content() { #returncode=1 fi - if ! glsa_image; then + if ! ROOT="$root" glsa_image; then returncode=1 fi