Error: SHELLCHECK_WARNING (CWE-670): [#def1] /usr/share/buildah/test/system/helpers.bash:4:40: warning[SC2128]: Expanding an array without an index only gives the first element. # 2| # 3| # Directory in which tests live # 4|-> TEST_SOURCES=${TEST_SOURCES:-$(dirname ${BASH_SOURCE})} # 5| # 6| BUILDAH_BINARY=${BUILDAH_BINARY:-$TEST_SOURCES/../bin/buildah} Error: SHELLCHECK_WARNING (CWE-670): [#def2] /usr/share/buildah/test/system/helpers.bash:12:16: warning[SC2128]: Expanding an array without an index only gives the first element. # 10| INET_BINARY=${INET_BINARY:-$TEST_SOURCES/../bin/inet} # 11| STORAGE_DRIVER=${STORAGE_DRIVER:-vfs} # 12|-> PATH=$(dirname ${BASH_SOURCE})/../bin:${PATH} # 13| OCI=${CI_DESIRED_RUNTIME:-$(${BUILDAH_BINARY} info --format '{{.host.OCIRuntime}}' || command -v runc || command -v crun)} # 14| # Default timeout for a buildah command. Error: SHELLCHECK_WARNING (CWE-156): [#def3] /usr/share/buildah/test/system/helpers.bash:26:6: warning[SC2046]: Quote this to prevent word splitting. # 24| # Prompt to display when logging buildah commands; distinguish root/rootless # 25| _LOG_PROMPT='$' # 26|-> if [ $(id -u) -eq 0 ]; then # 27| _LOG_PROMPT='#' # 28| fi Error: SHELLCHECK_WARNING (CWE-563): [#def4] /usr/share/buildah/test/system/helpers.bash:31:1: warning[SC2034]: BUDFILES appears unused. Verify use (or export if used externally). # 29| # 30| # Shortcut for directory containing Containerfiles for bud.bats # 31|-> BUDFILES=${TEST_SOURCES}/bud # 32| # 33| # Used hundreds of times throughout all the tests Error: SHELLCHECK_WARNING (CWE-563): [#def5] /usr/share/buildah/test/system/helpers.bash:34:1: warning[SC2034]: WITH_POLICY_JSON appears unused. Verify use (or export if used externally). # 32| # 33| # Used hundreds of times throughout all the tests # 34|-> WITH_POLICY_JSON="--signature-policy ${TEST_SOURCES}/policy.json" # 35| # 36| # We don't invoke gnupg directly in many places, but this avoids ENOTTY errors Error: SHELLCHECK_WARNING (CWE-252): [#def6] /usr/share/buildah/test/system/helpers.bash:46:5: warning[SC2164]: Use 'pushd ... || exit' or 'pushd ... || return' in case pushd fails. # 44| # 45| function setup_tests() { # 46|-> pushd "$(dirname "$(readlink -f "$BASH_SOURCE")")" # 47| # 48| # $TEST_SCRATCH_DIR is a custom scratch directory for each @test, Error: SHELLCHECK_WARNING (CWE-670): [#def7] /usr/share/buildah/test/system/helpers.bash:46:38: warning[SC2128]: Expanding an array without an index only gives the first element. # 44| # 45| function setup_tests() { # 46|-> pushd "$(dirname "$(readlink -f "$BASH_SOURCE")")" # 47| # 48| # $TEST_SCRATCH_DIR is a custom scratch directory for each @test, Error: SHELLCHECK_WARNING (CWE-252): [#def8] /usr/share/buildah/test/system/helpers.bash:93:5: warning[SC2164]: Use 'pushd ... || exit' or 'pushd ... || return' in case pushd fails. # 91| chmod 600 "$4" # 92| fi # 93|-> pushd ${2:-${TEST_SCRATCH_DIR}} > /dev/null # 94| go build -o serve ${TEST_SOURCES}/serve/serve.go # 95| portfile=$(mktemp) Error: SHELLCHECK_WARNING (CWE-563): [#def9] /usr/share/buildah/test/system/helpers.bash:124:5: warning[SC2034]: HTTP_SERVER_PORT appears unused. Verify use (or export if used externally). # 122| fi # 123| done # 124|-> HTTP_SERVER_PORT=$(cat ${portfile}) # 125| rm -f ${portfile} # 126| popd > /dev/null Error: SHELLCHECK_WARNING (CWE-252): [#def10] /usr/share/buildah/test/system/helpers.bash:126:5: warning[SC2164]: Use 'popd ... || exit' or 'popd ... || return' in case popd fails. # 124| HTTP_SERVER_PORT=$(cat ${portfile}) # 125| rm -f ${portfile} # 126|-> popd > /dev/null # 127| } # 128| Error: SHELLCHECK_WARNING (CWE-252): [#def11] /usr/share/buildah/test/system/helpers.bash:158:5: warning[SC2164]: Use 'popd ... || exit' or 'popd ... || return' in case popd fails. # 156| rm -fr ${TEST_SCRATCH_DIR} # 157| # 158|-> popd # 159| } # 160| Error: SHELLCHECK_WARNING: [#def12] /usr/share/buildah/test/system/helpers.bash:184:25: warning[SC2076]: Remove quotes from right-hand side of =~ to match as a regex rather than literally. # 182| local storage= # 183| for img in "$@"; do # 184|-> if [[ "$img" =~ '[vfs@' ]] ; then # 185| storage="$img" # 186| continue Error: SHELLCHECK_WARNING (CWE-563): [#def13] /usr/share/buildah/test/system/helpers.bash:206:9: warning[SC2034]: attempt appears unused. Verify use (or export if used externally). # 204| rm -fr ${_BUILDAH_IMAGE_CACHEDIR:?THIS CAN NEVER HAPPEN}/$fname # 205| echo "# [copy docker://$img dir:$_BUILDAH_IMAGE_CACHEDIR/$fname]" >&2 # 206|-> for attempt in $(seq 3) ; do # 207| if copy $COPY_REGISTRY_OPTS docker://"$img" dir:$_BUILDAH_IMAGE_CACHEDIR/$fname ; then # 208| break Error: SHELLCHECK_WARNING (CWE-670): [#def14] /usr/share/buildah/test/system/helpers.bash:348:62: warning[SC2128]: Expanding an array without an index only gives the first element. # 346| # stdout is only emitted upon error; this echo is to help a debugger # 347| echo "${_LOG_PROMPT} $BUILDAH_BINARY $*" # 348|-> run env CONTAINERS_CONF=${CONTAINERS_CONF:-$(dirname ${BASH_SOURCE})/containers.conf} timeout --foreground --kill=10 $BUILDAH_TIMEOUT ${BUILDAH_BINARY} ${BUILDAH_REGISTRY_OPTS} ${ROOTDIR_OPTS} "$@" # 349| # without "quotes", multiple lines are glommed together into one # 350| if [ -n "$output" ]; then Error: SHELLCHECK_WARNING (CWE-457): [#def15] /usr/share/buildah/test/system/helpers.bash:353:15: warning[SC2154]: status is referenced but not assigned. # 351| echo "$output" # 352| fi # 353|-> if [ "$status" -ne 0 ]; then # 354| echo -n "[ rc=$status "; # 355| if [ -n "$expected_rc" ]; then Error: SHELLCHECK_WARNING (CWE-477): [#def16] /usr/share/buildah/test/system/helpers.bash:365:32: warning[SC2166]: Prefer [ p ] || [ q ] as [ p -o q ] is not well defined. # 363| fi # 364| # 365|-> if [ "$status" -eq 124 -o "$status" -eq 137 ]; then # 366| # FIXME: 'timeout -v' requires coreutils-8.29; travis seems to have # 367| # an older version. If/when travis updates, please add -v Error: SHELLCHECK_WARNING (CWE-571): [#def17] /usr/share/buildah/test/system/helpers.bash:510:15: warning[SC2155]: Declare and assign separately to avoid masking return values. # 508| local opt # 509| for opt; do # 510|-> local value=$(expr "$opt" : '[^=]*=\(.*\)') # 511| case "$opt" in # 512| --from=*) actual="$value"; shift;; Error: SHELLCHECK_WARNING (CWE-457): [#def18] /usr/share/buildah/test/system/helpers.bash:533:19: warning[SC2154]: lines is referenced but not assigned (did you mean 'line'?). # 531| local testname="${2:-${MOST_RECENT_BUILDAH_COMMAND:-[no test name given]}}" # 532| # 533|-> local actual="${#lines[@]}" # 534| if [ "$actual" -eq "$expect" ]; then # 535| return Error: SHELLCHECK_WARNING (CWE-571): [#def19] /usr/share/buildah/test/system/helpers.bash:642:11: warning[SC2155]: Declare and assign separately to avoid masking return values. # 640| ################## # 641| function is_cgroupsv2() { # 642|-> local cgroupfs_t=$(stat -f -c %T /sys/fs/cgroup) # 643| test "$cgroupfs_t" = "cgroup2fs" # 644| } Error: SHELLCHECK_WARNING (CWE-156): [#def20] /usr/share/buildah/test/system/helpers.bash:701:31: warning[SC2046]: Quote this to prevent word splitting. # 699| skip "unshare was not able to create a pid namespace" # 700| fi # 701|-> if ! unshare -U --map-users $(id -u),0,1 true ; then # 702| skip "unshare does not support --map-users" # 703| fi Error: SHELLCHECK_WARNING (CWE-563): [#def21] /usr/share/buildah/test/system/helpers.bash:729:3: warning[SC2034]: GITPORT appears unused. Verify use (or export if used externally). # 727| fi # 728| done # 729|-> GITPORT=$(cat ${TEST_SCRATCH_DIR}/git-daemon/port) # 730| } # 731| Error: SHELLCHECK_WARNING (CWE-156): [#def22] /usr/share/buildah/test/system/helpers.bash:734:10: warning[SC2046]: Quote this to prevent word splitting. # 732| function stop_git_daemon() { # 733| if test -s ${TEST_SCRATCH_DIR}/git-daemon/pid ; then # 734|-> kill $(cat ${TEST_SCRATCH_DIR}/git-daemon/pid) # 735| rm -f ${TEST_SCRATCH_DIR}/git-daemon/pid # 736| fi Error: SHELLCHECK_WARNING (CWE-156): [#def23] /usr/share/buildah/test/system/test_runner.sh:16:22: warning[SC2046]: Quote this to prevent word splitting. # 14| # 15| # Run the tests. # 16|-> execute time bats -j $(nproc) --tap "${@:-.}"
| analyzer-version-clippy | 1.84.1 |
| analyzer-version-cppcheck | 2.16.2 |
| analyzer-version-gcc | 15.0.1 |
| analyzer-version-gcc-analyzer | 15.0.1 |
| analyzer-version-shellcheck | 0.10.0 |
| analyzer-version-unicontrol | 0.0.2 |
| diffbase-analyzer-version-clippy | 1.84.1 |
| diffbase-analyzer-version-cppcheck | 2.16.2 |
| diffbase-analyzer-version-gcc | 15.0.1 |
| diffbase-analyzer-version-gcc-analyzer | 15.0.1 |
| diffbase-analyzer-version-shellcheck | 0.10.0 |
| diffbase-analyzer-version-unicontrol | 0.0.2 |
| diffbase-enabled-plugins | clippy, cppcheck, gcc, shellcheck, unicontrol |
| diffbase-exit-code | 0 |
| diffbase-host | ip-172-16-1-66.us-west-2.compute.internal |
| diffbase-mock-config | fedora-rawhide-x86_64 |
| diffbase-project-name | buildah-1.39.0-1.20250214022822801876.pr5959.31.g149e7a04f |
| diffbase-store-results-to | /tmp/tmp0_2w5igc/buildah-1.39.0-1.20250214022822801876.pr5959.31.g149e7a04f.tar.xz |
| diffbase-time-created | 2025-02-14 03:02:45 |
| diffbase-time-finished | 2025-02-14 03:29:28 |
| diffbase-tool | csmock |
| diffbase-tool-args | '/usr/bin/csmock' '-r' 'fedora-rawhide-x86_64' '-t' 'cppcheck,clippy,shellcheck,gcc,unicontrol' '-o' '/tmp/tmp0_2w5igc/buildah-1.39.0-1.20250214022822801876.pr5959.31.g149e7a04f.tar.xz' '--gcc-analyze' '--unicontrol-notests' '--unicontrol-bidi-only' '/tmp/tmp0_2w5igc/buildah-1.39.0-1.20250214022822801876.pr5959.31.g149e7a04f.src.rpm' |
| diffbase-tool-version | csmock-3.8.0-1.el9 |
| enabled-plugins | clippy, cppcheck, gcc, shellcheck, unicontrol |
| exit-code | 0 |
| host | ip-172-16-1-66.us-west-2.compute.internal |
| mock-config | fedora-rawhide-x86_64 |
| project-name | buildah-1.39.0-1.20250211212939368860.main.26.g6cc75b8e0 |
| store-results-to | /tmp/tmpxhm4vetd/buildah-1.39.0-1.20250211212939368860.main.26.g6cc75b8e0.tar.xz |
| time-created | 2025-02-14 02:37:20 |
| time-finished | 2025-02-14 03:02:17 |
| title | Fixed findings |
| tool | csmock |
| tool-args | '/usr/bin/csmock' '-r' 'fedora-rawhide-x86_64' '-t' 'cppcheck,clippy,shellcheck,gcc,unicontrol' '-o' '/tmp/tmpxhm4vetd/buildah-1.39.0-1.20250211212939368860.main.26.g6cc75b8e0.tar.xz' '--gcc-analyze' '--unicontrol-notests' '--unicontrol-bidi-only' '/tmp/tmpxhm4vetd/buildah-1.39.0-1.20250211212939368860.main.26.g6cc75b8e0.src.rpm' |
| tool-version | csmock-3.8.0-1.el9 |