From a9a2186a76af63551352aa3bc296bdbe80ca4893 Mon Sep 17 00:00:00 2001 From: Yip Rui Fung Date: Sun, 15 Jan 2023 02:56:27 +0800 Subject: [PATCH] Fix docker_start.sh not properly handling env vars (#1993) For example, the COLLECTIONS environment variable is supposed to do a space separated list. But with the unquoted call to cscli_if_clean without quotes on the $COLLECTIONS environment variable, only the first entry is passed to it. As a result, only the first entry is installed. Would likely affect all call sites to cscli_if_clean --- docker/docker_start.sh | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/docker/docker_start.sh b/docker/docker_start.sh index 11833a049..cf7690fe3 100755 --- a/docker/docker_start.sh +++ b/docker/docker_start.sh @@ -265,43 +265,43 @@ cscli_if_clean parsers install crowdsecurity/docker-logs if [ "$COLLECTIONS" != "" ]; then # shellcheck disable=SC2086 - cscli_if_clean collections install $COLLECTIONS + cscli_if_clean collections install "$COLLECTIONS" fi if [ "$PARSERS" != "" ]; then # shellcheck disable=SC2086 - cscli_if_clean parsers install $PARSERS + cscli_if_clean parsers install "$PARSERS" fi if [ "$SCENARIOS" != "" ]; then # shellcheck disable=SC2086 - cscli_if_clean scenarios install $SCENARIOS + cscli_if_clean scenarios install "$SCENARIOS" fi if [ "$POSTOVERFLOWS" != "" ]; then # shellcheck disable=SC2086 - cscli_if_clean postoverflows install $POSTOVERFLOWS + cscli_if_clean postoverflows install "$POSTOVERFLOWS" fi ## Remove collections, parsers, scenarios & postoverflows if [ "$DISABLE_COLLECTIONS" != "" ]; then # shellcheck disable=SC2086 - cscli_if_clean collections remove $DISABLE_COLLECTIONS + cscli_if_clean collections remove "$DISABLE_COLLECTIONS" fi if [ "$DISABLE_PARSERS" != "" ]; then # shellcheck disable=SC2086 - cscli_if_clean parsers remove $DISABLE_PARSERS + cscli_if_clean parsers remove "$DISABLE_PARSERS" fi if [ "$DISABLE_SCENARIOS" != "" ]; then # shellcheck disable=SC2086 - cscli_if_clean scenarios remove $DISABLE_SCENARIOS + cscli_if_clean scenarios remove "$DISABLE_SCENARIOS" fi if [ "$DISABLE_POSTOVERFLOWS" != "" ]; then # shellcheck disable=SC2086 - cscli_if_clean postoverflows remove $DISABLE_POSTOVERFLOWS + cscli_if_clean postoverflows remove "$DISABLE_POSTOVERFLOWS" fi ## Register bouncers via env