redhat-rpm-config-296-1.fc42

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-563): [#def4]
/usr/lib/rpm/redhat/brp-mangle-shebangs:51:7: warning[SC2034]: exclude_shebangs appears unused. Verify use (or export if used externally).
#   49|         ;;
#   50|       --shebangs=*)
#   51|->       exclude_shebangs="${1##--shebangs=}"
#   52|         ;;
#   53|       --shebangs-from)

Error: SHELLCHECK_WARNING (CWE-563): [#def5]
/usr/lib/rpm/redhat/brp-mangle-shebangs:58:7: warning[SC2034]: exclude_shebangs_from appears unused. Verify use (or export if used externally).
#   56|         ;;
#   57|       --shebangs-from=*)
#   58|->       exclude_shebangs_from="${1##--shebangs-from=}"
#   59|         ;;
#   60|       --help|--usage|"-?"|-h)

Error: SHELLCHECK_WARNING (CWE-569): [#def6]
/usr/lib/rpm/redhat/config.sub:245:8: warning[SC2221]: This pattern always overrides a later one on line 247.
#  243|   					| semi \
#  244|   					| sequent* \
#  245|-> 					| siemens \
#  246|   					| sgi* \
#  247|   					| siemens \

Error: SHELLCHECK_WARNING (CWE-569): [#def7]
/usr/lib/rpm/redhat/config.sub:247:8: warning[SC2222]: This pattern never matches because of a previous pattern on line 245.
#  245|   					| siemens \
#  246|   					| sgi* \
#  247|-> 					| siemens \
#  248|   					| sim \
#  249|   					| sni \

Error: SHELLCHECK_WARNING (CWE-456): [#def8]
/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): [#def9]
/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-477): [#def10]
/usr/lib/rpm/redhat/find-provides:13:27: warning[SC2166]: Prefer [ p ] && [ q ] as [ p -a q ] is not well defined.
#   11|   filelist=`sed "s/['\"]/\\\&/g"`
#   12|   
#   13|-> [ -x /usr/lib/rpm/rpmdeps -a -n "$filelist" ] &&
#   14|       echo $filelist | tr '[:blank:]' \\n | /usr/lib/rpm/rpmdeps --provides
#   15|   

Error: SHELLCHECK_WARNING (CWE-156): [#def11]
/usr/lib/rpm/redhat/find-provides:33:10: warning[SC2046]: Quote this to prevent word splitting.
#   31|   is_kmod=1
#   32|   for f in $filelist; do
#   33|->     if [ $(echo "$f" | sed -r -ne 's:^.*/lib/modules/(.*)/(.*).ko$:\2:p') ]
#   34|       then
#   35|           is_kernel=1;

Error: SHELLCHECK_WARNING (CWE-156): [#def12]
/usr/lib/rpm/redhat/find-provides:37:10: warning[SC2046]: Quote this to prevent word splitting.
#   35|           is_kernel=1;
#   36|       fi
#   37|->     if [ $(echo "$f" | sed -r -ne 's:^.*/boot/(.*):\1:p') ]
#   38|       then
#   39|   	unset is_kmod;

Error: SHELLCHECK_WARNING (CWE-477): [#def13]
/usr/lib/rpm/redhat/find-requires:12:27: warning[SC2166]: Prefer [ p ] && [ q ] as [ p -a q ] is not well defined.
#   10|   filelist=`sed "s/[]['\"*?{}]/\\\\\&/g"`
#   11|   
#   12|-> [ -x /usr/lib/rpm/rpmdeps -a -n "$filelist" ] && \
#   13|       echo $filelist | tr '[:blank:]' \\n | /usr/lib/rpm/rpmdeps --requires
#   14|   

Error: SHELLCHECK_WARNING (CWE-156): [#def14]
/usr/lib/rpm/redhat/find-requires:25:10: warning[SC2046]: Quote this to prevent word splitting.
#   23|   
#   24|   for f in $filelist; do
#   25|->     if [ $(echo "$f" | sed -r -ne 's:^.*/lib/modules/(.*)/(.*).ko$:\2:p') ]
#   26|       then
#   27|           is_kmod=1;

Error: SHELLCHECK_WARNING (CWE-563): [#def15]
/usr/lib/rpm/redhat/find-requires:27:9: warning[SC2034]: is_kmod appears unused. Verify use (or export if used externally).
#   25|       if [ $(echo "$f" | sed -r -ne 's:^.*/lib/modules/(.*)/(.*).ko$:\2:p') ]
#   26|       then
#   27|->         is_kmod=1;
#   28|       elif [ $(echo "$f" | sed -r -ne 's:^.*/boot/(.*):\1:p') ]
#   29|       then

Error: SHELLCHECK_WARNING (CWE-156): [#def16]
/usr/lib/rpm/redhat/find-requires:28:12: warning[SC2046]: Quote this to prevent word splitting.
#   26|       then
#   27|           is_kmod=1;
#   28|->     elif [ $(echo "$f" | sed -r -ne 's:^.*/boot/(.*):\1:p') ]
#   29|       then
#   30|   	unset is_kmod;

Error: SHELLCHECK_WARNING (CWE-252): [#def17]
/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: [#def18]
/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): [#def19]
/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: [#def20]
/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): [#def21]
/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): [#def22]
/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: [#def23]
/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): [#def24]
/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: [#def25]
/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.82.0
analyzer-version-cppcheck2.16.0
analyzer-version-gcc14.2.1
analyzer-version-gcc-analyzer15.0.0
analyzer-version-shellcheck0.10.0
analyzer-version-unicontrol0.0.2
enabled-pluginsclippy, cppcheck, gcc, shellcheck, unicontrol
exit-code0
hostip-172-16-1-104.us-west-2.compute.internal
mock-configfedora-rawhide-gcc-latest-x86_64
project-nameredhat-rpm-config-296-1.fc42
store-results-to/tmp/tmpwcludr4b/redhat-rpm-config-296-1.fc42.tar.xz
time-created2024-11-13 03:05:05
time-finished2024-11-13 03:06:14
toolcsmock
tool-args'/usr/bin/csmock' '-r' 'fedora-rawhide-gcc-latest-x86_64' '-t' 'clippy,cppcheck,gcc,unicontrol,shellcheck' '-o' '/tmp/tmpwcludr4b/redhat-rpm-config-296-1.fc42.tar.xz' '--gcc-analyze' '--unicontrol-notests' '--unicontrol-bidi-only' '--install=gcc-latest' '--gcc-analyzer-bin=/opt/gcc-latest/bin/gcc' '/tmp/tmpwcludr4b/redhat-rpm-config-296-1.fc42.src.rpm'
tool-versioncsmock-3.7.1.20241107.094801.gb3f0f26.pr_192-1.el9