summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLyndon Brown <jnqnfe@gmail.com>2020-04-01 02:19:43 +0100
committerLuca Boccassi <bluca@debian.org>2020-04-01 18:03:20 +0000
commit1716958a8dd4b52b1d437a29d268c949b83767c0 (patch)
tree46fab6612f2bc3c0ed423dba227a71d673cf6ee2
parent314ca3d56a791ff175c721177eafd3e873445518 (diff)
downloadvyos-live-build-1716958a8dd4b52b1d437a29d268c949b83767c0.tar.gz
vyos-live-build-1716958a8dd4b52b1d437a29d268c949b83767c0.zip
bootstrap_cache: validate action param
-rwxr-xr-xscripts/build/bootstrap_cache8
1 files changed, 6 insertions, 2 deletions
diff --git a/scripts/build/bootstrap_cache b/scripts/build/bootstrap_cache
index 0338c9ef4..b9894fed8 100755
--- a/scripts/build/bootstrap_cache
+++ b/scripts/build/bootstrap_cache
@@ -24,14 +24,18 @@ Init_config_data "${@}"
# Check architecture
Check_crossarchitectures
-if ! In_list "bootstrap" ${LB_CACHE_STAGES}
-then
+if ! In_list "bootstrap" ${LB_CACHE_STAGES}; then
exit 0
fi
_ACTION="${1}"
shift
+if ! In_list "${_ACTION}" restore save; then
+ Echo_error "Invalid action parameter"
+ exit 1
+fi
+
# Set non-default stage file name
# Note, this (plus the applicable extension added below) must match that used in `bootstrap_debootstrap`
STAGE_FILE="bootstrap_cache.${_ACTION}"