From a0db375f91bad2e288a36ce298146e22672718d9 Mon Sep 17 00:00:00 2001 From: Jonas Weber Date: Thu, 4 Oct 2018 21:30:28 +0200 Subject: [PATCH] Disable SC2059 (printf injection) for staged_file We're explicitly allowing for 'printf injection' here, so it's ok to just disable the corresponding shellcheck check. --- cdist/conf/type/__staged_file/gencode-local | 3 +++ 1 file changed, 3 insertions(+) diff --git a/cdist/conf/type/__staged_file/gencode-local b/cdist/conf/type/__staged_file/gencode-local index 18bf09f5..c0d94e92 100755 --- a/cdist/conf/type/__staged_file/gencode-local +++ b/cdist/conf/type/__staged_file/gencode-local @@ -57,6 +57,7 @@ get_file() { } fetch_file() { + # shellcheck disable=SC2059 printf "$fetch_command" "$source" printf ' > "%s"\n' "$stage_file" } @@ -64,8 +65,10 @@ fetch_file() { fetch_and_prepare_file() { printf 'tmpdir="$(mktemp -d --tmpdir="/tmp" "%s")"\n' "${__type##*/}.XXXXXXXXXX" printf 'cd "$tmpdir"\n' + # shellcheck disable=SC2059 printf "$fetch_command > \"%s\"\n" "$source" "$source_file_name" prepare_command="$(cat "$__object/parameter/prepare-command")" + # shellcheck disable=SC2059 printf "$prepare_command > \"%s\"\n" "$source_file_name" "$stage_file" printf 'cd - >/dev/null\n' printf 'rm -rf "$tmpdir"\n'