Skip to content
This repository was archived by the owner on Sep 18, 2020. It is now read-only.

Commit 9a3c5a9

Browse files
author
Matthew Garrett
committed
Merge pull request #547 from mjg59/glsa
Verify GLSA status when building packages
2 parents 9b8a4ca + 9225543 commit 9a3c5a9

File tree

2 files changed

+27
-2
lines changed

2 files changed

+27
-2
lines changed

build_library/test_image_content.sh

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,26 @@
22
# Use of this source code is governed by a BSD-style license that can be
33
# found in the LICENSE file.
44

5+
GLSA_WHITELIST=("201412-09")
6+
7+
glsa_image() {
8+
VULNS=()
9+
GLSAS=`glsa-check-$BOARD -t all`
10+
for GLSA in $GLSAS; do
11+
if [[ " ${GLSA_WHITELIST[@]} " =~ " ${GLSA} " ]]; then
12+
continue
13+
else
14+
VULNS+=($GLSA)
15+
fi
16+
done
17+
if [[ ${#VULNS[@]} != 0 ]]; then
18+
echo "The following GLSAs apply: $VULNS"
19+
return 1
20+
fi
21+
22+
return 0
23+
}
24+
525
test_image_content() {
626
local root="$1"
727
local returncode=0
@@ -45,5 +65,9 @@ test_image_content() {
4565
#returncode=1
4666
fi
4767

68+
if ! glsa_image; then
69+
returncode=1
70+
fi
71+
4872
return $returncode
4973
}

setup_board

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,8 @@ exec sudo -E ${command} ${extra_args} "\$@"
8080
EOF
8181
# Note: parent will process these.
8282
wrappers+=( "${target}" )
83-
eval ${command^^}_WRAPPER="${target}" # ${foo^^} returns toupper($foo)
83+
upper=${command^^}
84+
eval ${upper/-/_}_WRAPPER="${target}" # ${foo^^} returns toupper($foo)
8485
}
8586

8687
generate_all_wrappers() {
@@ -90,7 +91,7 @@ generate_all_wrappers() {
9091
info "Generating wrapper scripts"
9192

9293
for wrapper in 'emerge --root-deps' ebuild eclean equery portageq \
93-
qcheck qfile qlist emaint; do
94+
qcheck qfile qlist emaint glsa-check; do
9495
_generate_wrapper ${wrapper}
9596
done
9697

0 commit comments

Comments
 (0)