Fixed findings

List of Findings

Error: SHELLCHECK_WARNING (CWE-457): [#def1]
/usr/bin/dracut:1623:41: warning[SC2154]: systemdprefix is referenced but not assigned.
# 1621|   
# 1622|           if ! [[ -s $uefi_stub ]]; then
# 1623|->             uefi_stub="$dracutsysrootdir${systemdprefix}/lib/systemd/boot/efi/linux${EFI_MACHINE_TYPE_NAME}.efi.stub"
# 1624|           fi
# 1625|   

Error: SHELLCHECK_WARNING (CWE-457): [#def2]
/usr/lib/dracut/dracut-init.sh:455:18: warning[SC2154]: udevdir is referenced but not assigned.
#  453|       for _prog in $(sed -nr 's/.*PROGRAM==?"([^ "]+).*/\1/p' "$1"); do
#  454|           _bin=""
#  455|->         if [[ -x ${udevdir}/$_prog ]]; then
#  456|               _bin="${udevdir}"/$_prog
#  457|           elif [[ ${_prog/\$env\{/} == "$_prog" ]]; then

Error: SHELLCHECK_WARNING (CWE-758): [#def3]
/usr/lib/dracut/dracut-version.sh:1:1: error[SC2148]: Tips depend on target shell and yours is unknown. Add a shebang or a 'shell' directive.
#    1|-> DRACUT_VERSION=107-8.fc44

Error: SHELLCHECK_WARNING (CWE-563): [#def4]
/usr/lib/dracut/dracut-version.sh:1:1: warning[SC2034]: DRACUT_VERSION appears unused. Verify use (or export if used externally).
#    1|-> DRACUT_VERSION=107-8.fc44

Error: SHELLCHECK_WARNING (CWE-457): [#def5]
/usr/lib/dracut/modules.d/00systemd/module-setup.sh:112:23: warning[SC2154]: dracutsysrootdir is referenced but not assigned.
#  110|       inst_multiple -o nologin
#  111|       {
#  112|->         grep '^adm:' "$dracutsysrootdir"/etc/passwd 2> /dev/null
#  113|           # we don't use systemd-networkd, but the user is in systemd.conf tmpfiles snippet
#  114|           grep '^systemd-network:' "$dracutsysrootdir"/etc/passwd 2> /dev/null

Error: SHELLCHECK_WARNING (CWE-457): [#def6]
/usr/lib/dracut/modules.d/01fips-crypto-policies/module-setup.sh:6:11: warning[SC2154]: dracutsysrootdir is referenced but not assigned.
#    4|   check() {
#    5|       # only enable on systems that use crypto-policies
#    6|->     [ -f "$dracutsysrootdir/usr/share/crypto-policies/default-fips-config" ] && return 0
#    7|   
#    8|       # include when something else depends on it or it is explicitly requested

Error: SHELLCHECK_WARNING (CWE-457): [#def7]
/usr/lib/dracut/modules.d/01fips/module-setup.sh:49:30: warning[SC2154]: hostonly_default_device is referenced but not assigned.
#   47|   
#   48|       # with hostonly_default_device fs module for /boot is not installed by default
#   49|->     if [[ $hostonly ]] && [[ $hostonly_default_device == "no" ]]; then
#   50|           _bootfstype=$(find_mp_fstype /boot)
#   51|           if [[ -n $_bootfstype ]]; then

Error: SHELLCHECK_WARNING (CWE-457): [#def8]
/usr/lib/dracut/modules.d/01systemd-cryptsetup/module-setup.sh:23:28: warning[SC2154]: dracutsysrootdir is referenced but not assigned.
#   21|       local deps
#   22|       deps="dm rootfs-block crypt systemd-ask-password"
#   23|->     if [[ $hostonly && -f "$dracutsysrootdir"/etc/crypttab ]]; then
#   24|           if grep -q -e "fido2-device=" -e "fido2-cid=" "$dracutsysrootdir"/etc/crypttab; then
#   25|               deps+=" fido2"

Error: SHELLCHECK_WARNING (CWE-457): [#def9]
/usr/lib/dracut/modules.d/01systemd-cryptsetup/module-setup.sh:59:33: warning[SC2154]: initdir is referenced but not assigned.
#   57|           "$systemdsystemunitdir"/initrd-root-device.target.wants/remote-cryptsetup.target
#   58|   
#   59|->     if [[ $hostonly ]] && [[ -f $initdir/etc/crypttab ]]; then
#   60|           # for each entry in /etc/crypttab check if the key file is backed by a socket unit and if so,
#   61|           # include it along with its corresponding service unit.

Error: SHELLCHECK_WARNING (CWE-457): [#def10]
/usr/lib/dracut/modules.d/01systemd-cryptsetup/module-setup.sh:73:77: warning[SC2154]: systemdsystemconfdir is referenced but not assigned.
#   71|               fi
#   72|   
#   73|->             find "$dracutsysrootdir$systemdsystemunitdir" "$dracutsysrootdir$systemdsystemconfdir" -type f -name "*.socket" | while read -r socket_unit; do
#   74|                   # systemd-cryptsetup utility only supports SOCK_STREAM (ListenStream) sockets, so we ignore
#   75|                   # other types like SOCK_DGRAM (ListenDatagram), SOCK_SEQPACKET (ListenSequentialPacket), etc.

Error: SHELLCHECK_WARNING (CWE-457): [#def11]
/usr/lib/dracut/modules.d/01systemd-modules-load/module-setup.sh:20:20: warning[SC2154]: dracutsysrootdir is referenced but not assigned.
#   18|       modules_load_get() {
#   19|           local _line _i
#   20|->         for _i in "$dracutsysrootdir$1"/*.conf; do
#   21|               [[ -f $_i ]] || continue
#   22|               while read -r _line || [ -n "$_line" ]; do

Error: SHELLCHECK_WARNING (CWE-457): [#def12]
/usr/lib/dracut/modules.d/01systemd-sysext/module-setup.sh:32:12: warning[SC2154]: dracutsysrootdir is referenced but not assigned.
#   30|   
#   31|       # systemd >= v258
#   32|->     [[ -e "$dracutsysrootdir$systemdsystemunitdir"/systemd-sysext-initrd.service ]] && _suffix="-initrd"
#   33|   
#   34|       # It's intended to work only with raw binary disk images contained in

Error: SHELLCHECK_WARNING (CWE-457): [#def13]
/usr/lib/dracut/modules.d/01systemd-sysext/module-setup.sh:32:29: warning[SC2154]: systemdsystemunitdir is referenced but not assigned.
#   30|   
#   31|       # systemd >= v258
#   32|->     [[ -e "$dracutsysrootdir$systemdsystemunitdir"/systemd-sysext-initrd.service ]] && _suffix="-initrd"
#   33|   
#   34|       # It's intended to work only with raw binary disk images contained in

Error: SHELLCHECK_WARNING (CWE-457): [#def14]
/usr/lib/dracut/modules.d/01systemd-sysusers/module-setup.sh:16:18: warning[SC2154]: moddir is referenced but not assigned.
#   14|   # Install the required file(s) and directories for the module in the initramfs.
#   15|   install() {
#   16|->     inst_simple "$moddir/sysusers-dracut.conf" "$systemdsystemunitdir/systemd-sysusers.service.d/sysusers-dracut.conf"
#   17|   
#   18|       inst_sysusers basic.conf

Error: SHELLCHECK_WARNING (CWE-457): [#def15]
/usr/lib/dracut/modules.d/01systemd-sysusers/module-setup.sh:16:49: warning[SC2154]: systemdsystemunitdir is referenced but not assigned.
#   14|   # Install the required file(s) and directories for the module in the initramfs.
#   15|   install() {
#   16|->     inst_simple "$moddir/sysusers-dracut.conf" "$systemdsystemunitdir/systemd-sysusers.service.d/sysusers-dracut.conf"
#   17|   
#   18|       inst_sysusers basic.conf

Error: SHELLCHECK_WARNING (CWE-457): [#def16]
/usr/lib/dracut/modules.d/01systemd-sysusers/module-setup.sh:28:14: warning[SC2154]: systemdsystemconfdir is referenced but not assigned.
#   26|       if [[ $hostonly ]]; then
#   27|           inst_multiple -H -o \
#   28|->             "$systemdsystemconfdir"/systemd-sysusers.service \
#   29|               "$systemdsystemconfdir/systemd-sysusers.service.d/*.conf"
#   30|       fi

Error: SHELLCHECK_WARNING (CWE-457): [#def17]
/usr/lib/dracut/modules.d/03modsign/module-setup.sh:15:19: warning[SC2154]: dracutsysrootdir is referenced but not assigned.
#   13|       # if no keys are present
#   14|       if [[ $hostonly ]]; then
#   15|->         x=$(echo "$dracutsysrootdir"/lib/modules/keys/*)
#   16|           [[ ${x} == "$dracutsysrootdir/lib/modules/keys/*" ]] && return 255
#   17|       fi

Error: SHELLCHECK_WARNING (CWE-457): [#def18]
/usr/lib/dracut/modules.d/06dbus-daemon/module-setup.sh:76:33: warning[SC2154]: dracutsysrootdir is referenced but not assigned.
#   74|   
#   75|       # Adding the user and group for dbus
#   76|->     grep '^\(d\|message\)bus:' "$dracutsysrootdir"/etc/passwd >> "$initdir/etc/passwd"
#   77|       grep '^\(d\|message\)bus:' "$dracutsysrootdir"/etc/group >> "$initdir/etc/group"
#   78|   

Error: SHELLCHECK_WARNING (CWE-457): [#def19]
/usr/lib/dracut/modules.d/10i18n/module-setup.sh:20:16: warning[SC2154]: dracutsysrootdir is referenced but not assigned.
#   18|           unset KEYMAP
#   19|           # shellcheck disable=SC1090
#   20|->         [[ -f "$dracutsysrootdir"/etc/vconsole.conf ]] && . "$dracutsysrootdir"/etc/vconsole.conf
#   21|       fi
#   22|   

Error: SHELLCHECK_WARNING (CWE-457): [#def20]
/usr/lib/dracut/modules.d/10i18n/module-setup.sh:139:23: warning[SC2154]: systemdsystemunitdir is referenced but not assigned.
#  137|               inst_rules 90-vconsole.rules
#  138|   
#  139|->             if [[ -e "$systemdsystemunitdir"/systemd-vconsole-setup.service ]]; then
#  140|                   inst_multiple -o \
#  141|                       "$systemdutildir"/systemd-vconsole-setup \

Error: SHELLCHECK_WARNING (CWE-457): [#def21]
/usr/lib/dracut/modules.d/10i18n/module-setup.sh:312:38: warning[SC2154]: i18n_install_all is referenced but not assigned.
#  310|           install_base
#  311|   
#  312|->         if [[ ${hostonly} ]] && ! [[ ${i18n_install_all} == "yes" ]]; then
#  313|               install_local_i18n || install_all_kbd
#  314|           else

Error: SHELLCHECK_WARNING (CWE-457): [#def22]
/usr/lib/dracut/modules.d/35connman/module-setup.sh:27:30: warning[SC2154]: dracutsysrootdir is referenced but not assigned.
#   25|       inst connmand-wait-online
#   26|       inst "$dbussystem"/connman.conf
#   27|->     [[ $hostonly ]] && [[ -f $dracutsysrootdir/etc/connman/main.conf ]] && inst /etc/connman/main.conf
#   28|       inst_dir /usr/lib/connman/plugins
#   29|       inst_dir /var/lib/connman

Error: SHELLCHECK_WARNING (CWE-457): [#def23]
/usr/lib/dracut/modules.d/35network-manager/module-setup.sh:51:50: warning[SC2154]: systemdsystemunitdir is referenced but not assigned.
#   49|           inst_simple "$moddir"/initrd-no-auto-default.conf /usr/lib/NetworkManager/conf.d/
#   50|   
#   51|->         inst_simple "$moddir"/nm-initrd.service "$systemdsystemunitdir"/nm-initrd.service
#   52|           inst_simple "$moddir"/nm-wait-online-initrd.service "$systemdsystemunitdir"/nm-wait-online-initrd.service
#   53|   

Error: SHELLCHECK_WARNING (CWE-457): [#def24]
/usr/lib/dracut/modules.d/35network-manager/module-setup.sh:58:49: warning[SC2154]: systemdnetworkconfdir is referenced but not assigned.
#   56|               "${systemdnetwork}/99-default.link" \
#   57|               "${systemdnetwork}/98-default-mac-none.link"
#   58|->         [[ $hostonly ]] && inst_multiple -H -o "${systemdnetworkconfdir}/*.link"
#   59|   
#   60|           $SYSTEMCTL -q --root "$initdir" enable nm-initrd.service

Error: SHELLCHECK_WARNING (CWE-457): [#def25]
/usr/lib/dracut/modules.d/35network-manager/module-setup.sh:60:31: warning[SC2154]: initdir is referenced but not assigned.
#   58|           [[ $hostonly ]] && inst_multiple -H -o "${systemdnetworkconfdir}/*.link"
#   59|   
#   60|->         $SYSTEMCTL -q --root "$initdir" enable nm-initrd.service
#   61|       fi
#   62|   

Error: SHELLCHECK_WARNING (CWE-457): [#def26]
/usr/lib/dracut/modules.d/45plymouth/module-setup.sh:8:18: warning[SC2154]: dracutsysrootdir is referenced but not assigned.
#    6|       [ -n "$_arch" ] && _dirs+=" /usr/lib/$_arch/plymouth"
#    7|       for _dir in $_dirs; do
#    8|->         if [ -x "$dracutsysrootdir""$_dir"/plymouth-populate-initrd ]; then
#    9|               echo "$_dir"
#   10|               return

Error: SHELLCHECK_WARNING (CWE-457): [#def27]
/usr/lib/dracut/modules.d/45plymouth/module-setup.sh:39:76: warning[SC2154]: initdir is referenced but not assigned.
#   37|       else
#   38|           PLYMOUTH_POPULATE_SOURCE_FUNCTIONS="$dracutfunctions" \
#   39|->             "$dracutsysrootdir""${PKGLIBDIR}"/plymouth-populate-initrd -t "$initdir" 2> /dev/null
#   40|       fi
#   41|   

Error: SHELLCHECK_WARNING (CWE-457): [#def28]
/usr/lib/dracut/modules.d/45plymouth/plymouth-populate-initrd.sh:20:14: warning[SC2154]: dracutsysrootdir is referenced but not assigned.
#   18|           "/usr/share/plymouth/themes/text/text.plymouth"
#   19|   
#   20|->     if [[ -d $dracutsysrootdir/usr/share/plymouth/themes/${PLYMOUTH_THEME} ]]; then
#   21|           for x in "/usr/share/plymouth/themes/${PLYMOUTH_THEME}"/*; do
#   22|               [[ -f "$dracutsysrootdir$x" ]] || break

Error: SHELLCHECK_WARNING (CWE-457): [#def29]
/usr/lib/dracut/modules.d/45url-lib/module-setup.sh:31:15: warning[SC2154]: dracutsysrootdir is referenced but not assigned.
#   29|   
#   30|       for _dir in $libdirs; do
#   31|->         [[ -d $dracutsysrootdir$_dir ]] || continue
#   32|           for _lib in "$dracutsysrootdir$_dir"/libcurl.so.* "$dracutsysrootdir$_dir"/libcrypto.so.*; do
#   33|               [[ -e $_lib ]] || continue

Error: SHELLCHECK_WARNING (CWE-457): [#def30]
/usr/lib/dracut/modules.d/62bluetooth/module-setup.sh:72:25: warning[SC2154]: dracutsysrootdir is referenced but not assigned.
#   70|   
#   71|       if [[ $hostonly ]]; then
#   72|->         var_lib_files=("$dracutsysrootdir"/var/lib/bluetooth/**)
#   73|   
#   74|           inst_multiple -o \

Error: SHELLCHECK_WARNING (CWE-457): [#def31]
/usr/lib/dracut/modules.d/90crypt/module-setup.sh:96:33: warning[SC2154]: dracutsysrootdir is referenced but not assigned.
#   94|       fi
#   95|   
#   96|->     if [[ $hostonly ]] && [[ -f $dracutsysrootdir/etc/crypttab ]]; then
#   97|           # filter /etc/crypttab for the devices we need
#   98|           while read -r _mapper _dev _luksfile _luksoptions || [ -n "$_mapper" ]; do

Error: SHELLCHECK_WARNING (CWE-457): [#def32]
/usr/lib/dracut/modules.d/90kernel-modules/module-setup.sh:157:31: warning[SC2154]: moddir is referenced but not assigned.
#  155|       [[ $hostonly ]] && inst_multiple -H -o /etc/modprobe.d/*.conf /etc/modprobe.conf
#  156|       if ! dracut_module_included "systemd"; then
#  157|->         inst_hook cmdline 01 "$moddir/parse-kernel.sh"
#  158|       fi
#  159|       inst_simple "$moddir/insmodpost.sh" /sbin/insmodpost.sh

Error: SHELLCHECK_WARNING (CWE-457): [#def33]
/usr/lib/dracut/modules.d/90lvm/module-setup.sh:61:30: warning[SC2154]: lvmconf is referenced but not assigned (did you mean '_lvmconf'?).
#   59|       inst_rules "$moddir/64-lvm.rules"
#   60|   
#   61|->     if [[ $hostonly ]] || [[ $lvmconf == "yes" ]]; then
#   62|           if [[ -f $dracutsysrootdir/etc/lvm/lvm.conf ]]; then
#   63|               inst_simple -H /etc/lvm/lvm.conf

Error: SHELLCHECK_WARNING (CWE-457): [#def34]
/usr/lib/dracut/modules.d/90lvm/module-setup.sh:62:18: warning[SC2154]: dracutsysrootdir is referenced but not assigned.
#   60|   
#   61|       if [[ $hostonly ]] || [[ $lvmconf == "yes" ]]; then
#   62|->         if [[ -f $dracutsysrootdir/etc/lvm/lvm.conf ]]; then
#   63|               inst_simple -H /etc/lvm/lvm.conf
#   64|           fi

Error: SHELLCHECK_WARNING (CWE-457): [#def35]
/usr/lib/dracut/modules.d/90mdraid/module-setup.sh:94:30: warning[SC2154]: mdadmconf is referenced but not assigned.
#   92|       inst_rules "$moddir/59-persistent-storage-md.rules"
#   93|   
#   94|->     if [[ $hostonly ]] || [[ $mdadmconf == "yes" ]]; then
#   95|           if [[ -f $dracutsysrootdir/etc/mdadm.conf ]]; then
#   96|               inst -H /etc/mdadm.conf

Error: SHELLCHECK_WARNING (CWE-457): [#def36]
/usr/lib/dracut/modules.d/90mdraid/module-setup.sh:95:18: warning[SC2154]: dracutsysrootdir is referenced but not assigned.
#   93|   
#   94|       if [[ $hostonly ]] || [[ $mdadmconf == "yes" ]]; then
#   95|->         if [[ -f $dracutsysrootdir/etc/mdadm.conf ]]; then
#   96|               inst -H /etc/mdadm.conf
#   97|           else

Error: SHELLCHECK_WARNING (CWE-457): [#def37]
/usr/lib/dracut/modules.d/90mdraid/module-setup.sh:118:35: warning[SC2154]: systemdsystemunitdir is referenced but not assigned.
#  116|       inst_script "$moddir/mdraid_start.sh" /sbin/mdraid_start
#  117|       if dracut_module_included "systemd"; then
#  118|->         if [[ -e $dracutsysrootdir$systemdsystemunitdir/mdmon@.service ]]; then
#  119|               inst_simple "$systemdsystemunitdir"/mdmon@.service
#  120|           fi

Error: SHELLCHECK_WARNING (CWE-457): [#def38]
/usr/lib/dracut/modules.d/90multipath/module-setup.sh:114:34: warning[SC2154]: hostonly_mode is referenced but not assigned.
#  112|   
#  113|       mpathconf_installed \
#  114|->         && [[ $hostonly ]] && [[ $hostonly_mode == "strict" ]] && {
#  115|           for_each_host_dev_and_slaves_all add_hostonly_mpath_conf
#  116|           if ((${#_allow[@]} > 0)); then

Error: SHELLCHECK_WARNING (CWE-457): [#def39]
/usr/lib/dracut/modules.d/91crypt-gpg/module-setup.sh:33:13: warning[SC2154]: dracutsysrootdir is referenced but not assigned.
#   31|           inst_multiple gpg-connect-agent
#   32|           inst_multiple -o /usr/libexec/scdaemon /usr/lib/gnupg/scdaemon
#   33|->         cp "$dracutsysrootdir$(sc_public_key)" "${initdir}/root/"
#   34|       fi
#   35|   }

Error: SHELLCHECK_WARNING (CWE-457): [#def40]
/usr/lib/dracut/modules.d/91crypt-gpg/module-setup.sh:33:49: warning[SC2154]: initdir is referenced but not assigned.
#   31|           inst_multiple gpg-connect-agent
#   32|           inst_multiple -o /usr/libexec/scdaemon /usr/lib/gnupg/scdaemon
#   33|->         cp "$dracutsysrootdir$(sc_public_key)" "${initdir}/root/"
#   34|       fi
#   35|   }

Error: SHELLCHECK_WARNING (CWE-457): [#def41]
/usr/lib/dracut/modules.d/95cifs/module-setup.sh:45:14: warning[SC2154]: dracutsysrootdir is referenced but not assigned.
#   43|   
#   44|       _nsslibs=$(
#   45|->         cat "$dracutsysrootdir"/{,usr/}etc/nsswitch.conf 2> /dev/null \
#   46|               | sed -e '/^#/d' -e 's/^.*://' -e 's/\[NOTFOUND=return\]//' \
#   47|               | tr -s '[:space:]' '\n' | sort -u | tr -s '[:space:]' '|'

Error: SHELLCHECK_WARNING (CWE-457): [#def42]
/usr/lib/dracut/modules.d/95debug/module-setup.sh:50:23: warning[SC2154]: dracutsysrootdir is referenced but not assigned.
#   48|           vi
#   49|   
#   50|->     grep '^tcpdump:' "$dracutsysrootdir"/etc/passwd 2> /dev/null >> "$initdir/etc/passwd"
#   51|   }

Error: SHELLCHECK_WARNING (CWE-457): [#def43]
/usr/lib/dracut/modules.d/95debug/module-setup.sh:50:70: warning[SC2154]: initdir is referenced but not assigned.
#   48|           vi
#   49|   
#   50|->     grep '^tcpdump:' "$dracutsysrootdir"/etc/passwd 2> /dev/null >> "$initdir/etc/passwd"
#   51|   }

Error: SHELLCHECK_WARNING (CWE-457): [#def44]
/usr/lib/dracut/modules.d/95fcoe/module-setup.sh:101:14: warning[SC2154]: dracutsysrootdir is referenced but not assigned.
#   99|   install() {
#  100|       inst_multiple ip dcbtool fipvlan lldpad readlink lldptool fcoemon fcoeadm tr
#  101|->     if [[ -e $dracutsysrootdir/etc/hba.conf ]]; then
#  102|           inst_libdir_file 'libhbalinux.so*'
#  103|           inst_simple "/etc/hba.conf"

Error: SHELLCHECK_WARNING (CWE-457): [#def45]
/usr/lib/dracut/modules.d/95fstab-sys/module-setup.sh:5:11: warning[SC2154]: dracutsysrootdir is referenced but not assigned.
#    3|   # called by dracut
#    4|   check() {
#    5|->     [[ -f $dracutsysrootdir/etc/fstab.sys ]] || [[ -n $add_fstab || -n $fstab_lines ]]
#    6|   }
#    7|   

Error: SHELLCHECK_WARNING (CWE-457): [#def46]
/usr/lib/dracut/modules.d/95iscsi/module-setup.sh:223:76: warning[SC2154]: dracutsysrootdir is referenced but not assigned.
#  221|               "$systemdsystemunitdir"/sockets.target.wants/iscsid.socket \
#  222|               "$systemdsystemunitdir"/sockets.target.wants/iscsiuio.socket
#  223|->         if grep -q '^ExecStartPre=/usr/lib/open-iscsi/startup-checks.sh$' "$dracutsysrootdir$systemdsystemunitdir/iscsid.service"; then
#  224|               inst_simple /usr/lib/open-iscsi/startup-checks.sh
#  225|           fi

Error: SHELLCHECK_WARNING (CWE-457): [#def47]
/usr/lib/dracut/modules.d/95nfs/module-setup.sh:90:14: warning[SC2154]: dracutsysrootdir is referenced but not assigned.
#   88|       fi
#   89|   
#   90|->     if [[ -f $dracutsysrootdir/lib/modprobe.d/nfs.conf ]]; then
#   91|           inst_multiple /lib/modprobe.d/nfs.conf
#   92|       else

Error: SHELLCHECK_WARNING (CWE-457): [#def48]
/usr/lib/dracut/modules.d/95resume/module-setup.sh:62:50: warning[SC2154]: dracutsysrootdir is referenced but not assigned.
#   60|   
#   61|       # if systemd is included and has the hibernate-resume tool, use it and nothing else
#   62|->     if dracut_module_included "systemd" && [[ -x $dracutsysrootdir$systemdutildir/systemd-hibernate-resume ]]; then
#   63|           inst_multiple -o \
#   64|               "$systemdutildir"/system-generators/systemd-hibernate-resume-generator \

Error: SHELLCHECK_WARNING (CWE-457): [#def49]
/usr/lib/dracut/modules.d/95resume/module-setup.sh:62:67: warning[SC2154]: systemdutildir is referenced but not assigned.
#   60|   
#   61|       # if systemd is included and has the hibernate-resume tool, use it and nothing else
#   62|->     if dracut_module_included "systemd" && [[ -x $dracutsysrootdir$systemdutildir/systemd-hibernate-resume ]]; then
#   63|           inst_multiple -o \
#   64|               "$systemdutildir"/system-generators/systemd-hibernate-resume-generator \

Error: SHELLCHECK_WARNING (CWE-457): [#def50]
/usr/lib/dracut/modules.d/95ssh-client/module-setup.sh:13:17: warning[SC2154]: dracutsysrootdir is referenced but not assigned.
#   11|   
#   12|       if [[ $sshkey ]]; then
#   13|->         [[ ! -f $dracutsysrootdir$sshkey ]] && {
#   14|               derror "ssh key: $sshkey is not found!"
#   15|               return 1

Error: SHELLCHECK_WARNING (CWE-457): [#def51]
/usr/lib/dracut/modules.d/95terminfo/module-setup.sh:8:15: warning[SC2154]: dracutsysrootdir is referenced but not assigned.
#    6|       # terminfo bits make things work better if you fall into interactive mode
#    7|       for _terminfodir in /lib/terminfo /etc/terminfo /usr/share/terminfo; do
#    8|->         [[ -f $dracutsysrootdir${_terminfodir}/l/linux ]] && break
#    9|       done
#   10|   

Error: SHELLCHECK_WARNING (CWE-457): [#def52]
/usr/lib/dracut/modules.d/95terminfo/module-setup.sh:14:31: warning[SC2154]: initdir is referenced but not assigned.
#   12|           for i in "l/linux" "v/vt100" "v/vt102" "v/vt220"; do
#   13|               inst_dir "$_terminfodir/${i%/*}"
#   14|->             $DRACUT_CP -L -t "${initdir}/${_terminfodir}/${i%/*}" "$dracutsysrootdir$_terminfodir/$i"
#   15|           done
#   16|       fi

Error: SHELLCHECK_WARNING (CWE-457): [#def53]
/usr/lib/dracut/modules.d/95udev-rules/module-setup.sh:14:15: warning[SC2154]: dracutsysrootdir is referenced but not assigned.
#   12|       [[ -d ${initdir}/$systemdutildir ]] || mkdir -p "${initdir}/$systemdutildir"
#   13|       for _i in "${systemdutildir}"/systemd-udevd "${udevdir}"/udevd /sbin/udevd; do
#   14|->         [[ -x $dracutsysrootdir$_i ]] || continue
#   15|           inst "$_i"
#   16|   

Error: SHELLCHECK_WARNING (CWE-457): [#def54]
/usr/lib/dracut/modules.d/98dracut-systemd/module-setup.sh:76:14: warning[SC2154]: dracutsysrootdir is referenced but not assigned.
#   74|       local PRETTY_NAME=""
#   75|       # Derive an os-release file from the host, if it exists
#   76|->     if [[ -e $dracutsysrootdir/etc/os-release ]]; then
#   77|           # shellcheck disable=SC1090
#   78|           . "$dracutsysrootdir"/etc/os-release

Error: SHELLCHECK_WARNING: [#def55]
/usr/lib/dracut/modules.d/99base/dracut-lib.sh:277:5: warning[SC3043]: In POSIX sh, 'local' is undefined.
#  275|       CMDLINE=$(getcmdline)
#  276|       export CMDLINE
#  277|->     local _val _i _gfound _deprecated
#  278|       unset _val
#  279|       unset _gfound

Error: SHELLCHECK_WARNING (CWE-457): [#def56]
/usr/lib/dracut/modules.d/99base/module-setup.sh:50:22: warning[SC2154]: dracutsysrootdir is referenced but not assigned.
#   48|       [[ $hostonly ]] && pwshadow='x'
#   49|       grep '^root:' "$initdir/etc/passwd" > /dev/null 2>&1 || echo "root:$pwshadow:0:0::/root:/bin/sh" >> "$initdir/etc/passwd"
#   50|->     grep '^nobody:' "$dracutsysrootdir"/etc/passwd >> "$initdir/etc/passwd"
#   51|   
#   52|       [[ $hostonly ]] && grep '^root:' "$dracutsysrootdir"/etc/shadow >> "$initdir/etc/shadow"

Error: SHELLCHECK_WARNING (CWE-457): [#def57]
/usr/lib/dracut/modules.d/99fs-lib/module-setup.sh:71:50: warning[SC2154]: dracutsysrootdir is referenced but not assigned.
#   69|       _helpers+=(umount mount)
#   70|   
#   71|->     if [[ ${_helpers[*]} == *e2fsck* ]] && [[ -e $dracutsysrootdir/etc/e2fsck.conf ]]; then
#   72|           inst_simple /etc/e2fsck.conf
#   73|       fi

Error: GCC_ANALYZER_WARNING (CWE-688): [#def58]
dracut-ng-107/src/install/dracut-install.c:857:13: warning[-Wanalyzer-possible-null-argument]: use of possibly-NULL ‘fullsrcpath’ where non-null expected
dracut-ng-107/src/install/dracut-install.c:1811:12: enter_function: entry to ‘install_dependent_modules’
dracut-ng-107/src/install/dracut-install.c:1816:9: branch_true: following ‘true’ branch (when ‘itr’ is non-NULL)...
dracut-ng-107/src/install/dracut-install.c:1818:23: branch_true: ...to here
dracut-ng-107/src/install/dracut-install.c:1819:21: call_function: calling ‘install_dependent_module’ from ‘install_dependent_modules’
#  855|           }
#  856|   
#  857|->         if (lstat(fullsrcpath, &sb) < 0) {
#  858|                   if (!isdir) {
#  859|                           i = strdup(src);

Error: GCC_ANALYZER_WARNING (CWE-775): [#def59]
dracut-ng-107/src/install/dracut-install.c:1628:15: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘open(&modalias_path, 524288)’
dracut-ng-107/src/install/dracut-install.c:2017:12: enter_function: entry to ‘install_modules’
dracut-ng-107/src/install/dracut-install.c:2034:12: branch_false: following ‘false’ branch (when ‘p’ is NULL)...
dracut-ng-107/src/install/dracut-install.c:2037:29: branch_false: ...to here
dracut-ng-107/src/install/dracut-install.c:2038:9: call_function: calling ‘find_suppliers’ from ‘install_modules’
# 1626|           char alias[page_size()];
# 1627|           ssize_t len = read(modalias_file, alias, sizeof(alias));
# 1628|->         alias[len - 1] = '\0';
# 1629|   
# 1630|           void *list;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def60]
dracut-ng-107/src/install/dracut-install.c:1639:17: warning[-Wanalyzer-malloc-leak]: leak of ‘strdup(__builtin_alloca_with_align(page_size(), 8))’
dracut-ng-107/src/install/dracut-install.c:2017:12: enter_function: entry to ‘install_modules’
dracut-ng-107/src/install/dracut-install.c:2034:12: branch_false: following ‘false’ branch (when ‘p’ is NULL)...
dracut-ng-107/src/install/dracut-install.c:2037:29: branch_false: ...to here
dracut-ng-107/src/install/dracut-install.c:2038:9: call_function: calling ‘find_suppliers’ from ‘install_modules’
# 1637|           int ret = kmod_module_new_from_lookup(ctx, alias, modules);
# 1638|           if (!ret) {
# 1639|->                 hashmap_put(modalias_to_kmod, strdup(alias), *modules);
# 1640|           }
# 1641|   

Error: GCC_ANALYZER_WARNING (CWE-401): [#def61]
dracut-ng-107/src/install/dracut-install.c:1687:39: warning[-Wanalyzer-malloc-leak]: leak of ‘opendir(&node_path)’
dracut-ng-107/src/install/dracut-install.c:2017:12: enter_function: entry to ‘install_modules’
dracut-ng-107/src/install/dracut-install.c:2034:12: branch_false: following ‘false’ branch (when ‘p’ is NULL)...
dracut-ng-107/src/install/dracut-install.c:2037:29: branch_false: ...to here
dracut-ng-107/src/install/dracut-install.c:2038:9: call_function: calling ‘find_suppliers’ from ‘install_modules’
# 1685|                   if (d) {
# 1686|                           size_t real_path_len = strlen(real_path);
# 1687|->                         while ((dir = readdir(d)) != NULL) {
# 1688|                                   if (strstr(dir->d_name, "supplier:platform") != NULL) {
# 1689|                                           if ((size_t)snprintf(real_path + real_path_len, sizeof(real_path) - real_path_len, "/%s/supplier",

Error: GCC_ANALYZER_WARNING (CWE-401): [#def62]
dracut-ng-107/src/install/dracut-install.c:1721:41: warning[-Wanalyzer-malloc-leak]: leak of ‘strdup(kmod_module_get_name(drv))’
dracut-ng-107/src/install/dracut-install.c:2017:12: enter_function: entry to ‘install_modules’
dracut-ng-107/src/install/dracut-install.c:2034:12: branch_false: following ‘false’ branch (when ‘p’ is NULL)...
dracut-ng-107/src/install/dracut-install.c:2037:29: branch_false: ...to here
dracut-ng-107/src/install/dracut-install.c:2038:9: call_function: calling ‘find_suppliers’ from ‘install_modules’
# 1719|                                   if (suppliers == NULL) {
# 1720|                                           suppliers = hashmap_new(string_hash_func, string_compare_func);
# 1721|->                                         hashmap_put(modules_suppliers, strdup(name), suppliers);
# 1722|                                   }
# 1723|   

Error: GCC_ANALYZER_WARNING (CWE-775): [#def63]
dracut-ng-107/src/install/util.h:552:12: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘open(&modalias_path, 524288)’
dracut-ng-107/src/install/dracut-install.c:2017:12: enter_function: entry to ‘install_modules’
dracut-ng-107/src/install/dracut-install.c:2034:12: branch_false: following ‘false’ branch (when ‘p’ is NULL)...
dracut-ng-107/src/install/dracut-install.c:2037:29: branch_false: ...to here
dracut-ng-107/src/install/dracut-install.c:2038:9: call_function: calling ‘find_suppliers’ from ‘install_modules’
#  550|   static inline void closep(int *fd)
#  551|   {
#  552|->         if (*fd >= 0)
#  553|                   close_nointr_nofail(*fd);
#  554|   }

Error: GCC_ANALYZER_WARNING (CWE-775): [#def64]
dracut-ng-107/src/install/util.h:553:17: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘open(&modalias_path, 524288)’
dracut-ng-107/src/install/dracut-install.c:2017:12: enter_function: entry to ‘install_modules’
dracut-ng-107/src/install/dracut-install.c:2034:12: branch_false: following ‘false’ branch (when ‘p’ is NULL)...
dracut-ng-107/src/install/dracut-install.c:2037:29: branch_false: ...to here
dracut-ng-107/src/install/dracut-install.c:2038:9: call_function: calling ‘find_suppliers’ from ‘install_modules’
#  551|   {
#  552|           if (*fd >= 0)
#  553|->                 close_nointr_nofail(*fd);
#  554|   }
#  555|   

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
diffbase-analyzer-version-clippy1.90.0
diffbase-analyzer-version-cppcheck2.18.3
diffbase-analyzer-version-gcc15.2.1
diffbase-analyzer-version-gcc-analyzer16.0.0
diffbase-analyzer-version-shellcheck0.11.0
diffbase-analyzer-version-unicontrol0.0.2
diffbase-enabled-pluginsclippy, cppcheck, gcc, shellcheck, unicontrol
diffbase-exit-code0
diffbase-hostip-172-16-1-231.us-west-2.compute.internal
diffbase-known-false-positives/usr/share/csmock/known-false-positives.js
diffbase-known-false-positives-rpmknown-false-positives-0.0.0.20250521.132812.g8eff701.main-1.el9.noarch
diffbase-mock-configfedora-rawhide-gcc-latest-x86_64
diffbase-project-namedracut-108-3.fc44
diffbase-store-results-to/tmp/tmpdil6pwcf/dracut-108-3.fc44.tar.xz
diffbase-time-created2025-10-28 17:43:26
diffbase-time-finished2025-10-28 17:45:22
diffbase-toolcsmock
diffbase-tool-args'/usr/bin/csmock' '-r' 'fedora-rawhide-gcc-latest-x86_64' '-t' 'gcc,cppcheck,shellcheck,clippy,unicontrol' '-o' '/tmp/tmpdil6pwcf/dracut-108-3.fc44.tar.xz' '--gcc-analyze' '--unicontrol-notests' '--unicontrol-bidi-only' '--install' 'pam' '--install=gcc-latest' '--gcc-analyzer-bin=/opt/gcc-latest/bin/gcc' '/tmp/tmpdil6pwcf/dracut-108-3.fc44.src.rpm'
diffbase-tool-versioncsmock-3.8.3.20251027.143044.ge6b947b-1.el9
enabled-pluginsclippy, cppcheck, gcc, shellcheck, unicontrol
exit-code0
hostip-172-16-1-231.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-namedracut-107-8.fc43
store-results-to/tmp/tmpp90ty_7w/dracut-107-8.fc43.tar.xz
time-created2025-10-28 17:40:41
time-finished2025-10-28 17:43:03
titleFixed findings
toolcsmock
tool-args'/usr/bin/csmock' '-r' 'fedora-rawhide-gcc-latest-x86_64' '-t' 'gcc,cppcheck,shellcheck,clippy,unicontrol' '-o' '/tmp/tmpp90ty_7w/dracut-107-8.fc43.tar.xz' '--gcc-analyze' '--unicontrol-notests' '--unicontrol-bidi-only' '--install' 'pam' '--install=gcc-latest' '--gcc-analyzer-bin=/opt/gcc-latest/bin/gcc' '/tmp/tmpp90ty_7w/dracut-107-8.fc43.src.rpm'
tool-versioncsmock-3.8.3.20251027.143044.ge6b947b-1.el9