kdump-utils-1.0.49-1.fc42

List of Findings

Error: SHELLCHECK_WARNING (CWE-156): [#def1]
/usr/bin/kdumpctl:1702:13: warning[SC2046]: Quote this to prevent word splitting.
# 1700|   	fi
# 1701|   
# 1702|-> 	if ! lsblk $(get_mount_info SOURCE target "$_dir") > /dev/null; then
# 1703|   		derror "$VMCORE_CREATION_STATUS must on local drive"
# 1704|   		exit 1

Error: SHELLCHECK_WARNING (CWE-563): [#def2]
/usr/lib/kdump/kdump-lib-initramfs.sh:7:1: warning[SC2034]: DEFAULT_SSHKEY appears unused. Verify use (or export if used externally).
#    5|   
#    6|   DEFAULT_PATH="/var/crash/"
#    7|-> DEFAULT_SSHKEY="/root/.ssh/kdump_id_rsa"
#    8|   KDUMP_CONFIG_FILE="/etc/kdump.conf"
#    9|   FENCE_KDUMP_CONFIG_FILE="/etc/sysconfig/fence_kdump"

Error: SHELLCHECK_WARNING (CWE-563): [#def3]
/usr/lib/kdump/kdump-lib-initramfs.sh:9:1: warning[SC2034]: FENCE_KDUMP_CONFIG_FILE appears unused. Verify use (or export if used externally).
#    7|   DEFAULT_SSHKEY="/root/.ssh/kdump_id_rsa"
#    8|   KDUMP_CONFIG_FILE="/etc/kdump.conf"
#    9|-> FENCE_KDUMP_CONFIG_FILE="/etc/sysconfig/fence_kdump"
#   10|   FENCE_KDUMP_SEND="/usr/libexec/fence_kdump_send"
#   11|   LVM_CONF="/etc/lvm/lvm.conf"

Error: SHELLCHECK_WARNING (CWE-563): [#def4]
/usr/lib/kdump/kdump-lib-initramfs.sh:10:1: warning[SC2034]: FENCE_KDUMP_SEND appears unused. Verify use (or export if used externally).
#    8|   KDUMP_CONFIG_FILE="/etc/kdump.conf"
#    9|   FENCE_KDUMP_CONFIG_FILE="/etc/sysconfig/fence_kdump"
#   10|-> FENCE_KDUMP_SEND="/usr/libexec/fence_kdump_send"
#   11|   LVM_CONF="/etc/lvm/lvm.conf"
#   12|   VMCORE_CREATION_STATUS="/var/crash/vmcore-creation.status"

Error: SHELLCHECK_WARNING (CWE-563): [#def5]
/usr/lib/kdump/kdump-lib-initramfs.sh:11:1: warning[SC2034]: LVM_CONF appears unused. Verify use (or export if used externally).
#    9|   FENCE_KDUMP_CONFIG_FILE="/etc/sysconfig/fence_kdump"
#   10|   FENCE_KDUMP_SEND="/usr/libexec/fence_kdump_send"
#   11|-> LVM_CONF="/etc/lvm/lvm.conf"
#   12|   VMCORE_CREATION_STATUS="/var/crash/vmcore-creation.status"
#   13|   

Error: SHELLCHECK_WARNING (CWE-563): [#def6]
/usr/lib/kdump/kdump-lib-initramfs.sh:12:1: warning[SC2034]: VMCORE_CREATION_STATUS appears unused. Verify use (or export if used externally).
#   10|   FENCE_KDUMP_SEND="/usr/libexec/fence_kdump_send"
#   11|   LVM_CONF="/etc/lvm/lvm.conf"
#   12|-> VMCORE_CREATION_STATUS="/var/crash/vmcore-creation.status"
#   13|   
#   14|   # Read kdump config in well formated style

Error: SHELLCHECK_WARNING: [#def7]
/usr/lib/kdump/kdump-lib-initramfs.sh:106:2: warning[SC3043]: In POSIX sh, 'local' is undefined.
#  104|   get_mntpoint_from_target()
#  105|   {
#  106|-> 	local _mntpoint
#  107|   	# get the first TARGET when SOURCE doesn't end with ].
#  108|   	# In most cases, a SOURCE ends with ] when fsroot or subvol exists.

Error: SHELLCHECK_WARNING: [#def8]
/usr/lib/kdump/kdump-lib-initramfs.sh:112:2: warning[SC3010]: In POSIX sh, [[ ]] is undefined.
#  110|   
#  111|   	# fallback to the old way when _mntpoint is empty.
#  112|-> 	[[ -n "$_mntpoint" ]] || _mntpoint=$(get_mount_info TARGET source "$1" -f )
#  113|   	echo $_mntpoint
#  114|   }

Error: SHELLCHECK_WARNING: [#def9]
/usr/lib/kdump/kdump-lib-initramfs.sh:190:2: warning[SC3010]: In POSIX sh, [[ ]] is undefined.
#  188|   	_dir=$(dirname "$_status_file")
#  189|   
#  190|-> 	[[ -d "$_dir" ]] || mkdir -p "$_dir"
#  191|   
#  192|   	_mnt_op=$(get_mount_info OPTIONS target "$_dir" -f)

Error: SHELLCHECK_WARNING (CWE-563): [#def10]
/usr/lib/kdump/kdump-lib.sh:667:3: warning[SC2034]: KDUMP_INITRD appears unused. Verify use (or export if used externally).
#  665|   		KDUMP_INITRD="$var_target_initrd_dir/$kdump_initrd_base"
#  666|   	else
#  667|-> 		KDUMP_INITRD="$KDUMP_BOOTDIR/$kdump_initrd_base"
#  668|   	fi
#  669|   }

Error: SHELLCHECK_WARNING (CWE-685): [#def11]
/usr/lib/kdump/kdump-lib.sh:989:1: warning[SC2120]: kdump_get_arch_recommend_crashkernel references arguments, but none are ever passed.
#  987|   # $1 dump mode, if not specified, dump_mode will be judged by is_fadump_capable
#  988|   # $2 kernel-release, if not specified, got by _get_kdump_kernel_version
#  989|-> kdump_get_arch_recommend_crashkernel()
#  990|   {
#  991|   	local _arch _ck_cmdline _dump_mode

Error: SHELLCHECK_WARNING: [#def12]
/usr/lib/kdump/kdump-logger.sh:118:11: warning[SC3028]: In POSIX sh, UID is undefined.
#  116|       [ -n "$kdump_maxloglvl" ] && return 0
#  117|   
#  118|->     if [ "$UID" -ne 0 ]; then
#  119|           kdump_kmsgloglvl=0
#  120|           kdump_sysloglvl=0

Error: SHELLCHECK_WARNING: [#def13]
/usr/lib/kdump/kdump-logger.sh:131:18: warning[SC3023]: In POSIX sh, FDs outside 0-9 are undefined.
#  129|               readonly _dlogfd=15
#  130|               systemd-cat -t 'kdump' --level-prefix=true <"$_systemdcatfile" &
#  131|->             exec 15>"$_systemdcatfile"
#  132|           elif ! [ -S /dev/log ] && [ -w /dev/log ] || ! command -v logger >/dev/null; then
#  133|               # We cannot log to syslog, so turn this facility off.

Error: SHELLCHECK_WARNING (CWE-563): [#def14]
/usr/lib/kernel/install.d/60-kdump.install:6:1: warning[SC2034]: KERNEL_IMAGE appears unused. Verify use (or export if used externally).
#    4|   KERNEL_VERSION="$2"
#    5|   KDUMP_INITRD_DIR_ABS="$3"
#    6|-> KERNEL_IMAGE="$4"
#    7|   
#    8|   if ! [[ ${KERNEL_INSTALL_MACHINE_ID-x} ]]; then

Error: SHELLCHECK_WARNING (CWE-563): [#def15]
/usr/lib/kernel/install.d/92-crashkernel.install:5:1: warning[SC2034]: KDUMP_INITRD_DIR_ABS appears unused. Verify use (or export if used externally).
#    3|   COMMAND="$1"
#    4|   KERNEL_VERSION="$2"
#    5|-> KDUMP_INITRD_DIR_ABS="$3"
#    6|   KERNEL_IMAGE="$4"
#    7|   

Error: SHELLCHECK_WARNING (CWE-563): [#def16]
/usr/lib/kernel/install.d/92-crashkernel.install:6:1: warning[SC2034]: KERNEL_IMAGE appears unused. Verify use (or export if used externally).
#    4|   KERNEL_VERSION="$2"
#    5|   KDUMP_INITRD_DIR_ABS="$3"
#    6|-> KERNEL_IMAGE="$4"
#    7|   
#    8|   case "$COMMAND" in

Error: SHELLCHECK_WARNING (CWE-156): [#def17]
/usr/sbin/mkdumprd:433:38: warning[SC2046]: Quote this to prevent word splitting.
#  431|   fi
#  432|   
#  433|-> status_target=$(get_target_from_path $(dirname "$VMCORE_CREATION_STATUS"))
#  434|   
#  435|   if [[ $(get_root_fs_device) != "$status_target" ]]; then

Error: SHELLCHECK_WARNING (CWE-156): [#def18]
/usr/sbin/mkdumprd:436:36: warning[SC2046]: Quote this to prevent word splitting.
#  434|   
#  435|   if [[ $(get_root_fs_device) != "$status_target" ]]; then
#  436|-> 	new_mntpoint=$(echo /vmcorestatus/$(get_mntpoint_from_target "$status_target") \
#  437|   		| tr -s "/")
#  438|   	add_mount "$status_target" "" "" "$new_mntpoint"

Error: SHELLCHECK_WARNING (CWE-398): [#def19]
/usr/sbin/mkdumprd:440:11: error[SC2199]: Arrays implicitly concatenate in [[ ]]. Use a loop (or explicit * instead of @).
#  438|   	add_mount "$status_target" "" "" "$new_mntpoint"
#  439|   elif ! is_fadump_capable && \
#  440|->      ! [[ ${dracut_args[@]} == *"$(kdump_get_persistent_dev $status_target)"* ]]; then
#  441|   	add_mount "$status_target"
#  442|   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-195.us-west-2.compute.internal
mock-configfedora-rawhide-gcc-latest-x86_64
project-namekdump-utils-1.0.49-1.fc42
store-results-to/tmp/tmp51n7rftn/kdump-utils-1.0.49-1.fc42.tar.xz
time-created2024-11-13 00:30:41
time-finished2024-11-13 00:31:47
toolcsmock
tool-args'/usr/bin/csmock' '-r' 'fedora-rawhide-gcc-latest-x86_64' '-t' 'clippy,cppcheck,gcc,unicontrol,shellcheck' '-o' '/tmp/tmp51n7rftn/kdump-utils-1.0.49-1.fc42.tar.xz' '--gcc-analyze' '--unicontrol-notests' '--unicontrol-bidi-only' '--install=gcc-latest' '--gcc-analyzer-bin=/opt/gcc-latest/bin/gcc' '/tmp/tmp51n7rftn/kdump-utils-1.0.49-1.fc42.src.rpm'
tool-versioncsmock-3.7.1.20241107.094801.gb3f0f26.pr_192-1.el9