redhat-rpm-config-343-14.fc44

List of Findings

Error: SHELLCHECK_WARNING (CWE-477): [#def1]
/usr/lib/rpm/redhat/brp-ldconfig:5:27: warning[SC2166]: Prefer [ p ] || [ q ] as [ p -o q ] is not well defined.
#    3|   
#    4|   # If using normal root, avoid changing anything.
#    5|-> if [ -z "$RPM_BUILD_ROOT" -o "$RPM_BUILD_ROOT" = "/" ]; then
#    6|     exit 0
#    7|   fi

Error: SHELLCHECK_WARNING (CWE-156): [#def2]
/usr/lib/rpm/redhat/brp-ldconfig:11:19: warning[SC2046]: Quote this to prevent word splitting.
#    9|   # Create an empty config file for ldconfig to shut up a warning
#   10|   config=$(mktemp -p "$RPM_BUILD_ROOT")
#   11|-> /sbin/ldconfig -f $(basename "$config") -N -r "$RPM_BUILD_ROOT"
#   12|   rm -f "$config"
#   13|   # TODO: warn if it created new symlinks and guide people.

Error: SHELLCHECK_WARNING (CWE-477): [#def3]
/usr/lib/rpm/redhat/brp-mangle-shebangs:4:27: warning[SC2166]: Prefer [ p ] || [ q ] as [ p -o q ] is not well defined.
#    2|   
#    3|   # If using normal root, avoid changing anything.
#    4|-> if [ -z "$RPM_BUILD_ROOT" -o "$RPM_BUILD_ROOT" = "/" ]; then
#    5|     exit 0
#    6|   fi

Error: SHELLCHECK_WARNING (CWE-456): [#def4]
/usr/lib/rpm/redhat/dist.sh:41:2: warning[SC2209]: Use var=$(command) to assign output (or quote to assign string).
#   39|   if [ -n "$DISTNUM" ]; then
#   40|       if [ -n "$DISTFC" ]; then
#   41|-> 	DISTTYPE=fc
#   42|       elif [ -n "$DISTRHEL" ]; then
#   43|   	DISTTYPE=el

Error: SHELLCHECK_WARNING (CWE-477): [#def5]
/usr/lib/rpm/redhat/dist.sh:48:18: warning[SC2166]: Prefer [ p ] && [ q ] as [ p -a q ] is not well defined.
#   46|       fi
#   47|   fi
#   48|-> [ -n "$DISTTYPE" -a -n "$DISTNUM" ] && DISTTAG=".${DISTTYPE}${DISTNUM}"
#   49|   
#   50|   case "$1" in

Error: SHELLCHECK_WARNING (CWE-252): [#def6]
/usr/lib/rpm/redhat/redhat-annobin-plugin-select.sh:183:5: warning[SC2164]: Use 'pushd ... || exit' or 'pushd ... || return' in case pushd fails.
#  181|   	echo "  redhat-rpm-config: Installing annobin version of $rac1"
#  182|       fi
#  183|->     pushd $rrcdir > /dev/null
#  184|       rm -f $rac1
#  185|       ln -s $select_annobin "$rac1"

Error: SHELLCHECK_WARNING: [#def7]
/usr/lib/rpm/redhat/redhat-annobin-plugin-select.sh:183:5: warning[SC3044]: In POSIX sh, 'pushd' is undefined.
#  181|   	echo "  redhat-rpm-config: Installing annobin version of $rac1"
#  182|       fi
#  183|->     pushd $rrcdir > /dev/null
#  184|       rm -f $rac1
#  185|       ln -s $select_annobin "$rac1"

Error: SHELLCHECK_WARNING (CWE-252): [#def8]
/usr/lib/rpm/redhat/redhat-annobin-plugin-select.sh:186:5: warning[SC2164]: Use 'popd ... || exit' or 'popd ... || return' in case popd fails.
#  184|       rm -f $rac1
#  185|       ln -s $select_annobin "$rac1"
#  186|->     popd > /dev/null
#  187|       
#  188|   else if [ $install_gcc_version -eq 1 ]

Error: SHELLCHECK_WARNING: [#def9]
/usr/lib/rpm/redhat/redhat-annobin-plugin-select.sh:186:5: warning[SC3044]: In POSIX sh, 'popd' is undefined.
#  184|       rm -f $rac1
#  185|       ln -s $select_annobin "$rac1"
#  186|->     popd > /dev/null
#  187|       
#  188|   else if [ $install_gcc_version -eq 1 ]

Error: SHELLCHECK_WARNING (CWE-398): [#def10]
/usr/lib/rpm/redhat/redhat-annobin-plugin-select.sh:188:1: error[SC1075]: Use 'elif' instead of 'else if' (or put 'if' on new line if nesting).
#  186|       popd > /dev/null
#  187|       
#  188|-> else if [ $install_gcc_version -eq 1 ]
#  189|        then
#  190|   	if [ $debug -eq 1 ]

Error: SHELLCHECK_WARNING (CWE-252): [#def11]
/usr/lib/rpm/redhat/redhat-annobin-plugin-select.sh:194:2: warning[SC2164]: Use 'pushd ... || exit' or 'pushd ... || return' in case pushd fails.
#  192|   	    echo "  redhat-rpm-config: Installing gcc version of $rac1"
#  193|   	fi
#  194|-> 	pushd $rrcdir > /dev/null
#  195|   	rm -f $rac1
#  196|   	ln -s $select_gcc $rac1

Error: SHELLCHECK_WARNING: [#def12]
/usr/lib/rpm/redhat/redhat-annobin-plugin-select.sh:194:2: warning[SC3044]: In POSIX sh, 'pushd' is undefined.
#  192|   	    echo "  redhat-rpm-config: Installing gcc version of $rac1"
#  193|   	fi
#  194|-> 	pushd $rrcdir > /dev/null
#  195|   	rm -f $rac1
#  196|   	ln -s $select_gcc $rac1

Error: SHELLCHECK_WARNING (CWE-252): [#def13]
/usr/lib/rpm/redhat/redhat-annobin-plugin-select.sh:197:2: warning[SC2164]: Use 'popd ... || exit' or 'popd ... || return' in case popd fails.
#  195|   	rm -f $rac1
#  196|   	ln -s $select_gcc $rac1
#  197|-> 	popd > /dev/null
#  198|        fi
#  199|   fi

Error: SHELLCHECK_WARNING: [#def14]
/usr/lib/rpm/redhat/redhat-annobin-plugin-select.sh:197:2: warning[SC3044]: In POSIX sh, 'popd' is undefined.
#  195|   	rm -f $rac1
#  196|   	ln -s $select_gcc $rac1
#  197|-> 	popd > /dev/null
#  198|        fi
#  199|   fi

Scan Properties

analyzer-version-clippy1.90.0
analyzer-version-cppcheck2.18.3
analyzer-version-gcc15.2.1
analyzer-version-gcc-analyzer16.0.0
analyzer-version-shellcheck0.11.0
analyzer-version-unicontrol0.0.2
enabled-pluginsclippy, cppcheck, gcc, shellcheck, unicontrol
exit-code0
hostip-172-16-1-233.us-west-2.compute.internal
known-false-positives/usr/share/csmock/known-false-positives.js
known-false-positives-rpmknown-false-positives-0.0.0.20250521.132812.g8eff701.main-1.el9.noarch
mock-configfedora-rawhide-gcc-latest-x86_64
project-nameredhat-rpm-config-343-14.fc44
store-results-to/tmp/tmp_ttxd0j6/redhat-rpm-config-343-14.fc44.tar.xz
time-created2025-10-28 20:29:14
time-finished2025-10-28 20:30:25
toolcsmock
tool-args'/usr/bin/csmock' '-r' 'fedora-rawhide-gcc-latest-x86_64' '-t' 'gcc,cppcheck,shellcheck,clippy,unicontrol' '-o' '/tmp/tmp_ttxd0j6/redhat-rpm-config-343-14.fc44.tar.xz' '--gcc-analyze' '--unicontrol-notests' '--unicontrol-bidi-only' '--install' 'pam' '--install=gcc-latest' '--gcc-analyzer-bin=/opt/gcc-latest/bin/gcc' '/tmp/tmp_ttxd0j6/redhat-rpm-config-343-14.fc44.src.rpm'
tool-versioncsmock-3.8.3.20251027.143044.ge6b947b-1.el9