initscripts-10.26-1.fc42

List of Findings

Error: SHELLCHECK_WARNING (CWE-252): [#def1]
/usr/libexec/import-state:6:1: warning[SC2164]: Use 'cd ... || exit' or 'cd ... || return' in case cd fails.
#    4|   # Copy state into root folder:
#    5|   # ============================
#    6|-> cd /run/initramfs/state
#    7|   
#    8|   IFS_backup=$IFS

Error: SHELLCHECK_WARNING (CWE-252): [#def2]
/usr/libexec/import-state:14:3: warning[SC2164]: Use 'pushd ... || exit' or 'pushd ... || return' in case pushd fails.
#   12|   
#   13|   for dir in $dirs_found; do
#   14|->   pushd "$dir" > /dev/null
#   15|   
#   16|     # Remove initial '.' char from the find's result:

Error: SHELLCHECK_WARNING (CWE-252): [#def3]
/usr/libexec/import-state:29:3: warning[SC2164]: Use 'popd ... || exit' or 'popd ... || return' in case popd fails.
#   27|     find . -mindepth 1 -maxdepth 1 -not -type d -exec cp -av -t "$dest_dir" {} \; > /dev/null
#   28|   
#   29|->   popd > /dev/null
#   30|   done
#   31|   

Error: SHELLCHECK_WARNING (CWE-156): [#def4]
/usr/libexec/netconsole:99:7: warning[SC2046]: Quote this to prevent word splitting.
#   97|   		exit 6
#   98|   	fi
#   99|-> 	eval $(print_address_info $SYSLOGADDR)
#  100|   
#  101|   	if [ -z "$SYSLOGMACADDR" ]; then

Error: SHELLCHECK_WARNING (CWE-153): [#def5]
/usr/libexec/readonly-root:119:33: warning[SC2053]: Quote the right-hand side of = in [[ ]] to prevent glob matching.
#  117|                   prefix=0
#  118|                   for mount_point in "${MOUNTS[@]}"; do
#  119|->                         [[ $m = $mount_point ]] && continue
#  120|                           if [[ $m =~ ^$mount_point/.* ]] ; then
#  121|                                   prefix=1

Error: SHELLCHECK_WARNING (CWE-477): [#def6]
/usr/libexec/readonly-root:139:33: warning[SC2166]: Prefer [ p ] || [ q ] as [ p -o q ] is not well defined.
#  137|   	# must be done even if we have local storage.
#  138|   	ipaddr=
#  139|-> 	if [ "$HOSTNAME" = "localhost" -o "$HOSTNAME" = "localhost.localdomain" ]; then
#  140|   		ipaddr=$(ip addr show to 0.0.0.0/0 scope global | awk '/[[:space:]]inet / { print gensub("/.*","","g",$2) }')
#  141|   		for ip in $ipaddr ; do

Error: SHELLCHECK_WARNING (CWE-563): [#def7]
/usr/libexec/readonly-root:141:3: warning[SC2034]: ip appears unused. Verify use (or export if used externally).
#  139|   	if [ "$HOSTNAME" = "localhost" -o "$HOSTNAME" = "localhost.localdomain" ]; then
#  140|   		ipaddr=$(ip addr show to 0.0.0.0/0 scope global | awk '/[[:space:]]inet / { print gensub("/.*","","g",$2) }')
#  141|-> 		for ip in $ipaddr ; do
#  142|   			HOSTNAME=
#  143|   			eval $(ipcalc -h $ipaddr 2>/dev/null)

Error: SHELLCHECK_WARNING (CWE-156): [#def8]
/usr/libexec/readonly-root:143:9: warning[SC2046]: Quote this to prevent word splitting.
#  141|   		for ip in $ipaddr ; do
#  142|   			HOSTNAME=
#  143|-> 			eval $(ipcalc -h $ipaddr 2>/dev/null)
#  144|   			[ -n "$HOSTNAME" ] && { hostname ${HOSTNAME} ; break; }
#  145|   		done

Error: GCC_ANALYZER_WARNING (CWE-775): [#def9]
initscripts-10.26-build/initscripts-10.26/src/genhostid.c: scope_hint: In function ‘main’
initscripts-10.26-build/initscripts-10.26/src/genhostid.c:45:16: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘open("/dev/random", 0)’
#   43|     int fd = open ("/dev/random", O_RDONLY);
#   44|   
#   45|->   if (fd == -1 || read (fd, &n, sizeof (n)) != sizeof (n)) {
#   46|       srand48 ((long int) time (NULL) ^ (long int) getpid ());
#   47|       n = lrand48 ();

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-157.us-west-2.compute.internal
mock-configfedora-rawhide-gcc-latest-x86_64
project-nameinitscripts-10.26-1.fc42
store-results-to/tmp/tmpqj47k484/initscripts-10.26-1.fc42.tar.xz
time-created2024-11-13 00:20:57
time-finished2024-11-13 00:22:06
toolcsmock
tool-args'/usr/bin/csmock' '-r' 'fedora-rawhide-gcc-latest-x86_64' '-t' 'clippy,cppcheck,gcc,unicontrol,shellcheck' '-o' '/tmp/tmpqj47k484/initscripts-10.26-1.fc42.tar.xz' '--gcc-analyze' '--unicontrol-notests' '--unicontrol-bidi-only' '--install=gcc-latest' '--gcc-analyzer-bin=/opt/gcc-latest/bin/gcc' '/tmp/tmpqj47k484/initscripts-10.26-1.fc42.src.rpm'
tool-versioncsmock-3.7.1.20241107.094801.gb3f0f26.pr_192-1.el9