Error: SHELLCHECK_WARNING (CWE-477): [#def1] /usr/lib/dracut/dracut-initramfs-restore:86:33: warning[SC2166]: Prefer [ p ] && [ q ] as [ p -a q ] is not well defined. # 84| # 85| if grep -q -w selinux /sys/kernel/security/lsm 2> /dev/null \ # 86|-> && [ -e /etc/selinux/config -a -x /usr/sbin/setfiles ]; then # 87| . /etc/selinux/config # 88| if [[ $SELINUX != "disabled" && -n $SELINUXTYPE ]]; then Error: SHELLCHECK_WARNING (CWE-758): [#def2] /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=102-3.fc42 Error: SHELLCHECK_WARNING (CWE-563): [#def3] /usr/lib/dracut/dracut-version.sh:1:1: warning[SC2034]: DRACUT_VERSION appears unused. Verify use (or export if used externally). # 1|-> DRACUT_VERSION=102-3.fc42 Error: SHELLCHECK_WARNING (CWE-477): [#def4] /usr/lib/dracut/modules.d/00warpclock/module-setup.sh:10:25: warning[SC2166]: Prefer [ p ] || [ q ] as [ p -o q ] is not well defined. # 8| # hwclock does not exist on S390(x), bail out silently then # 9| local _arch=${DRACUT_ARCH:-$(uname -m)} # 10|-> [ "$_arch" = "s390" -o "$_arch" = "s390x" ] && return 1 # 11| # 12| # If the binary(s) requirements are not fulfilled the module can't be installed. Error: SHELLCHECK_WARNING: [#def5] /usr/lib/dracut/modules.d/01fips/fips.sh:97:10: warning[SC3045]: In POSIX sh, read -d is undefined. # 95| local _found # 96| # 97|-> read -d '' -r FIPSMODULES < /etc/fipsmodules # 98| # 99| fips_info "Loading and integrity checking all crypto modules" Error: SHELLCHECK_WARNING (CWE-477): [#def6] /usr/lib/dracut/modules.d/01fips/fips.sh:106:39: warning[SC2166]: Prefer [ p ] && [ q ] as [ p -a q ] is not well defined. # 104| _found=0 # 105| while read -r _k _ _v || [ -n "$_k" ]; do # 106|-> [ "$_k" != "name" -a "$_k" != "driver" ] && continue # 107| [ "$_v" != "$_module" ] && continue # 108| _found=1 Error: SHELLCHECK_WARNING (CWE-457): [#def7] /usr/lib/dracut/modules.d/01systemd-coredump/module-setup.sh:40:10: warning[SC2154]: sysusers is referenced but not assigned. # 38| "$systemdsystemunitdir"/systemd-coredump@.service \ # 39| "$systemdsystemunitdir"/sockets.target.wants/systemd-coredump.socket \ # 40|-> "$sysusers"/systemd-coredump.conf \ # 41| coredumpctl # 42| Error: SHELLCHECK_WARNING (CWE-457): [#def8] /usr/lib/dracut/modules.d/01systemd-coredump/module-setup.sh:60:14: warning[SC2154]: sysusersconfdir is referenced but not assigned. # 58| "$systemdsystemconfdir/systemd-coredump@.service.d/*.conf" \ # 59| "$systemdsystemconfdir"/sockets.target.wants/systemd-coredump.socket \ # 60|-> "$sysusersconfdir"/systemd-coredump.conf # 61| fi # 62| } Error: SHELLCHECK_WARNING (CWE-457): [#def9] /usr/lib/dracut/modules.d/01systemd-journald/module-setup.sh:50:10: warning[SC2154]: sysusers is referenced but not assigned. # 48| "$systemdsystemunitdir"/sockets.target.wants/systemd-journald.socket \ # 49| "$systemdsystemunitdir"/sysinit.target.wants/systemd-journald.service \ # 50|-> "$sysusers"/systemd-journal.conf \ # 51| journalctl # 52| Error: SHELLCHECK_WARNING (CWE-457): [#def10] /usr/lib/dracut/modules.d/01systemd-journald/module-setup.sh:70:14: warning[SC2154]: sysusersconfdir is referenced but not assigned. # 68| "$systemdsystemconfdir"/systemd-journal-catalog-update.service \ # 69| "$systemdsystemconfdir/systemd-journal-catalog-update.service.d/*.conf" \ # 70|-> "$sysusersconfdir"/systemd-journal.conf # 71| fi # 72| Error: SHELLCHECK_WARNING (CWE-457): [#def11] /usr/lib/dracut/modules.d/01systemd-networkd/module-setup.sh:58:10: warning[SC2154]: sysusers is referenced but not assigned. # 56| "$systemdsystemunitdir"/systemd-networkd-wait-online@.service \ # 57| "$systemdsystemunitdir"/systemd-network-generator.service \ # 58|-> "$sysusers"/systemd-network.conf \ # 59| ip # 60| Error: SHELLCHECK_WARNING (CWE-457): [#def12] /usr/lib/dracut/modules.d/01systemd-networkd/module-setup.sh:75:14: warning[SC2154]: systemdnetworkconfdir is referenced but not assigned. # 73| "$systemdutilconfdir"/networkd.conf \ # 74| "$systemdutilconfdir/networkd.conf.d/*.conf" \ # 75|-> "$systemdnetworkconfdir/*" \ # 76| "$systemdsystemconfdir"/systemd-networkd.service \ # 77| "$systemdsystemconfdir/systemd-networkd.service.d/*.conf" \ Error: SHELLCHECK_WARNING (CWE-457): [#def13] /usr/lib/dracut/modules.d/01systemd-networkd/module-setup.sh:86:14: warning[SC2154]: sysusersconfdir is referenced but not assigned. # 84| "$systemdsystemconfdir"/systemd-networkd-wait-online@.service \ # 85| "$systemdsystemconfdir/systemd-networkd-wait-online@.service.d/*.conf" \ # 86|-> "$sysusersconfdir"/systemd-network.conf # 87| fi # 88| } Error: SHELLCHECK_WARNING (CWE-457): [#def14] /usr/lib/dracut/modules.d/01systemd-resolved/module-setup.sh:43:10: warning[SC2154]: sysusers is referenced but not assigned. # 41| "$systemdsystemunitdir"/systemd-resolved.service \ # 42| "$systemdsystemunitdir/systemd-resolved.service.d/*.conf" \ # 43|-> "$sysusers"/systemd-resolve.conf \ # 44| resolvectl # 45| Error: SHELLCHECK_WARNING (CWE-457): [#def15] /usr/lib/dracut/modules.d/01systemd-resolved/module-setup.sh:56:14: warning[SC2154]: sysusersconfdir is referenced but not assigned. # 54| "$systemdsystemconfdir"/systemd-resolved.service \ # 55| "$systemdsystemconfdir/systemd-resolved.service.d/*.conf" \ # 56|-> "$sysusersconfdir"/systemd-resolve.conf # 57| fi # 58| } Error: SHELLCHECK_WARNING (CWE-457): [#def16] /usr/lib/dracut/modules.d/01systemd-sysusers/module-setup.sh:30:10: warning[SC2154]: sysusers is referenced but not assigned. # 28| # 29| inst_multiple -o \ # 30|-> "$sysusers"/basic.conf \ # 31| "$sysusers"/systemd.conf \ # 32| "$systemdsystemunitdir"/systemd-sysusers.service \ Error: SHELLCHECK_WARNING (CWE-457): [#def17] /usr/lib/dracut/modules.d/01systemd-sysusers/module-setup.sh:39:14: warning[SC2154]: sysusersconfdir is referenced but not assigned. # 37| if [[ $hostonly ]]; then # 38| inst_multiple -H -o \ # 39|-> "$sysusersconfdir"/basic.conf \ # 40| "$sysusersconfdir"/systemd.conf \ # 41| "$systemdsystemconfdir"/systemd-sysusers.service \ Error: SHELLCHECK_WARNING (CWE-457): [#def18] /usr/lib/dracut/modules.d/01systemd-timesyncd/module-setup.sh:46:10: warning[SC2154]: sysusers is referenced but not assigned. # 44| "$systemdsystemunitdir"/systemd-time-wait-sync.service \ # 45| "$systemdsystemunitdir/systemd-time-wait-sync.service.d/*.conf" \ # 46|-> "$sysusers"/systemd-timesync.conf # 47| # 48| # Enable systemd type unit(s) Error: SHELLCHECK_WARNING (CWE-457): [#def19] /usr/lib/dracut/modules.d/01systemd-timesyncd/module-setup.sh:65:14: warning[SC2154]: sysusersconfdir is referenced but not assigned. # 63| "$systemdsystemconfdir"/systemd-time-wait-sync.service \ # 64| "$systemdsystemconfdir/systemd-time-wait-sync.service.d/*.conf" \ # 65|-> "$sysusersconfdir"/systemd-timesync.conf # 66| fi # 67| } Error: SHELLCHECK_WARNING (CWE-457): [#def20] /usr/lib/dracut/modules.d/01systemd-udevd/module-setup.sh:34:10: warning[SC2154]: udevdir is referenced but not assigned. # 32| inst_multiple -o \ # 33| /etc/udev/udev.hwdb \ # 34|-> "$udevdir"/hwdb.bin \ # 35| "$udevdir"/dmi_memory_id \ # 36| "$udevdir"/fido_id \ Error: SHELLCHECK_WARNING (CWE-457): [#def21] /usr/lib/dracut/modules.d/01systemd-udevd/module-setup.sh:40:10: warning[SC2154]: udevrulesdir is referenced but not assigned. # 38| "$udevdir"/mtp-probe \ # 39| "$udevdir"/v4l_id \ # 40|-> "$udevrulesdir"/60-autosuspend.rules \ # 41| "$udevrulesdir"/60-drm.rules \ # 42| "$udevrulesdir"/60-evdev.rules \ Error: SHELLCHECK_WARNING (CWE-457): [#def22] /usr/lib/dracut/modules.d/01systemd-udevd/module-setup.sh:76:14: warning[SC2154]: udevconfdir is referenced but not assigned. # 74| if [[ $hostonly ]]; then # 75| inst_multiple -H -o \ # 76|-> "$udevconfdir"/hwdb.bin \ # 77| "$udevrulesconfdir/*.rules" \ # 78| "$systemdutilconfdir"/hwdb/hwdb.bin \ Error: SHELLCHECK_WARNING (CWE-457): [#def23] /usr/lib/dracut/modules.d/01systemd-udevd/module-setup.sh:77:14: warning[SC2154]: udevrulesconfdir is referenced but not assigned. # 75| inst_multiple -H -o \ # 76| "$udevconfdir"/hwdb.bin \ # 77|-> "$udevrulesconfdir/*.rules" \ # 78| "$systemdutilconfdir"/hwdb/hwdb.bin \ # 79| "$systemdsystemconfdir"/systemd-udevd.service \ Error: SHELLCHECK_WARNING (CWE-457): [#def24] /usr/lib/dracut/modules.d/01systemd-udevd/module-setup.sh:78:14: warning[SC2154]: systemdutilconfdir is referenced but not assigned. # 76| "$udevconfdir"/hwdb.bin \ # 77| "$udevrulesconfdir/*.rules" \ # 78|-> "$systemdutilconfdir"/hwdb/hwdb.bin \ # 79| "$systemdsystemconfdir"/systemd-udevd.service \ # 80| "$systemdsystemconfdir/systemd-udevd.service.d/*.conf" \ Error: SHELLCHECK_WARNING (CWE-477): [#def25] /usr/lib/dracut/modules.d/02caps/caps.sh:15:41: warning[SC2166]: Prefer [ p ] && [ q ] as [ p -a q ] is not well defined. # 13| for i in $CAPS_MODULES; do modprobe "$i" 2>&1 > /dev/null | vinfo; done # 14| # 15|-> if [ "$CAPS_MODULES_DISABLED" = "1" -a -e /proc/sys/kernel/modules_disabled ]; then # 16| info "Disabling module loading." # 17| echo "$CAPS_MODULES_DISABLED" > /proc/sys/kernel/modules_disabled Error: SHELLCHECK_WARNING (CWE-477): [#def26] /usr/lib/dracut/modules.d/02caps/caps.sh:20:39: warning[SC2166]: Prefer [ p ] && [ q ] as [ p -a q ] is not well defined. # 18| fi # 19| # 20|-> if [ "$CAPS_KEXEC_DISABLED" = "1" -a -e /proc/sys/kernel/kexec_disabled ]; then # 21| info "Disabling kexec." # 22| echo "$CAPS_KEXEC_DISABLED" > /proc/sys/kernel/kexec_disabled Error: SHELLCHECK_WARNING (CWE-457): [#def27] /usr/lib/dracut/modules.d/06dbus-broker/module-setup.sh:50:10: warning[SC2154]: sysusers is referenced but not assigned. # 48| "$dbusservicesconfdir"/org.freedesktop.systemd1.service \ # 49| "$dbussystemservices"/org.freedesktop.systemd1.service \ # 50|-> "$sysusers"/dbus.conf \ # 51| "$systemdcatalog"/dbus-broker.catalog \ # 52| "$systemdcatalog"/dbus-broker-launch.catalog \ Error: SHELLCHECK_WARNING (CWE-457): [#def28] /usr/lib/dracut/modules.d/06dbus-broker/module-setup.sh:78:14: warning[SC2154]: sysusersconfdir is referenced but not assigned. # 76| "$dbusconfdir"/session.conf \ # 77| "$dbusconfdir"/system.conf \ # 78|-> "$sysusersconfdir"/dbus.conf \ # 79| "$systemdsystemconfdir"/dbus.socket \ # 80| "$systemdsystemconfdir"/dbus.socket.d/*.conf \ Error: SHELLCHECK_WARNING (CWE-477): [#def29] /usr/lib/dracut/modules.d/30convertfs/convertfs.sh:24:27: warning[SC2166]: Prefer [ p ] && [ q ] as [ p -a q ] is not well defined. # 22| done # 23| # 24|-> if [ ! -L "$ROOT"/var/run -a -e "$ROOT"/var/run ]; then # 25| echo "Converting /var/run to symlink" # 26| mv -f "$ROOT"/var/run "$ROOT"/var/run.runmove~ Error: SHELLCHECK_WARNING (CWE-477): [#def30] /usr/lib/dracut/modules.d/30convertfs/convertfs.sh:30:28: warning[SC2166]: Prefer [ p ] && [ q ] as [ p -a q ] is not well defined. # 28| fi # 29| # 30|-> if [ ! -L "$ROOT"/var/lock -a -e "$ROOT"/var/lock ]; then # 31| echo "Converting /var/lock to symlink" # 32| mv -f "$ROOT"/var/lock "$ROOT"/var/lock.lockmove~ Error: SHELLCHECK_WARNING (CWE-477): [#def31] /usr/lib/dracut/modules.d/45net-lib/ifname-genrules.sh:20:26: warning[SC2166]: Prefer [ p ] && [ q ] as [ p -a q ] is not well defined. # 18| read -r oldmac < /tmp/ifname-"$ifname_if" # 19| fi # 20|-> if [ -n "$oldif" -a -n "$oldmac" -a "$oldif" = "$ifname_if" -a "$oldmac" = "$ifname_mac" ]; then # 21| # skip same ifname= declaration # 22| continue Error: SHELLCHECK_WARNING (CWE-477): [#def32] /usr/lib/dracut/modules.d/45net-lib/ifname-genrules.sh:20:42: warning[SC2166]: Prefer [ p ] && [ q ] as [ p -a q ] is not well defined. # 18| read -r oldmac < /tmp/ifname-"$ifname_if" # 19| fi # 20|-> if [ -n "$oldif" -a -n "$oldmac" -a "$oldif" = "$ifname_if" -a "$oldmac" = "$ifname_mac" ]; then # 21| # skip same ifname= declaration # 22| continue Error: SHELLCHECK_WARNING (CWE-477): [#def33] /usr/lib/dracut/modules.d/45net-lib/ifname-genrules.sh:20:69: warning[SC2166]: Prefer [ p ] && [ q ] as [ p -a q ] is not well defined. # 18| read -r oldmac < /tmp/ifname-"$ifname_if" # 19| fi # 20|-> if [ -n "$oldif" -a -n "$oldmac" -a "$oldif" = "$ifname_if" -a "$oldmac" = "$ifname_mac" ]; then # 21| # skip same ifname= declaration # 22| continue Error: SHELLCHECK_WARNING (CWE-477): [#def34] /usr/lib/dracut/modules.d/45net-lib/net-lib.sh:322:49: warning[SC2166]: Prefer [ p ] || [ q ] as [ p -o q ] is not well defined. # 320| fi # 321| fi # 322|-> if [ -n "$ip" ] && [ -n "$mask" -o -n "$prefix" ]; then # 323| echo "ip=$ip::$gw:$mask:$hostname:$dev:none${dns1:+:$dns1}${dns2:+:$dns2}" # 324| else Error: SHELLCHECK_WARNING (CWE-477): [#def35] /usr/lib/dracut/modules.d/45net-lib/net-lib.sh:520:24: warning[SC2166]: Prefer [ p ] || [ q ] as [ p -o q ] is not well defined. # 518| fi # 519| # 520|-> if [ "$2" = "dhcp" -o "$2" = "on" -o "$2" = "any" -o "$2" = "dhcp6" -o "$2" = "auto6" -o "$2" = "either6" ]; then # 521| # format: ip=<interface>:{dhcp|on|any|dhcp6|auto6}[:[<mtu>][:<macaddr>]] # 522| [ -n "$1" ] && dev="$1" Error: SHELLCHECK_WARNING (CWE-477): [#def36] /usr/lib/dracut/modules.d/45net-lib/net-lib.sh:520:39: warning[SC2166]: Prefer [ p ] || [ q ] as [ p -o q ] is not well defined. # 518| fi # 519| # 520|-> if [ "$2" = "dhcp" -o "$2" = "on" -o "$2" = "any" -o "$2" = "dhcp6" -o "$2" = "auto6" -o "$2" = "either6" ]; then # 521| # format: ip=<interface>:{dhcp|on|any|dhcp6|auto6}[:[<mtu>][:<macaddr>]] # 522| [ -n "$1" ] && dev="$1" Error: SHELLCHECK_WARNING (CWE-477): [#def37] /usr/lib/dracut/modules.d/45net-lib/net-lib.sh:520:55: warning[SC2166]: Prefer [ p ] || [ q ] as [ p -o q ] is not well defined. # 518| fi # 519| # 520|-> if [ "$2" = "dhcp" -o "$2" = "on" -o "$2" = "any" -o "$2" = "dhcp6" -o "$2" = "auto6" -o "$2" = "either6" ]; then # 521| # format: ip=<interface>:{dhcp|on|any|dhcp6|auto6}[:[<mtu>][:<macaddr>]] # 522| [ -n "$1" ] && dev="$1" Error: SHELLCHECK_WARNING (CWE-477): [#def38] /usr/lib/dracut/modules.d/45net-lib/net-lib.sh:520:73: warning[SC2166]: Prefer [ p ] || [ q ] as [ p -o q ] is not well defined. # 518| fi # 519| # 520|-> if [ "$2" = "dhcp" -o "$2" = "on" -o "$2" = "any" -o "$2" = "dhcp6" -o "$2" = "auto6" -o "$2" = "either6" ]; then # 521| # format: ip=<interface>:{dhcp|on|any|dhcp6|auto6}[:[<mtu>][:<macaddr>]] # 522| [ -n "$1" ] && dev="$1" Error: SHELLCHECK_WARNING (CWE-477): [#def39] /usr/lib/dracut/modules.d/45net-lib/net-lib.sh:520:91: warning[SC2166]: Prefer [ p ] || [ q ] as [ p -o q ] is not well defined. # 518| fi # 519| # 520|-> if [ "$2" = "dhcp" -o "$2" = "on" -o "$2" = "any" -o "$2" = "dhcp6" -o "$2" = "auto6" -o "$2" = "either6" ]; then # 521| # format: ip=<interface>:{dhcp|on|any|dhcp6|auto6}[:[<mtu>][:<macaddr>]] # 522| [ -n "$1" ] && dev="$1" Error: SHELLCHECK_WARNING (CWE-477): [#def40] /usr/lib/dracut/modules.d/45net-lib/net-lib.sh:549:28: warning[SC2166]: Prefer [ p ] && [ q ] as [ p -a q ] is not well defined. # 547| [0-9]*) # 548| mtu="$8" # 549|-> if [ -n "${9}" -a -z "${10}" ]; then # 550| macaddr="${9}" # 551| elif [ -n "${9}" -a -n "${10}" -a -n "${11}" -a -n "${12}" -a -n "${13}" -a -n "${14}" ]; then Error: SHELLCHECK_WARNING (CWE-477): [#def41] /usr/lib/dracut/modules.d/45net-lib/net-lib.sh:551:30: warning[SC2166]: Prefer [ p ] && [ q ] as [ p -a q ] is not well defined. # 549| if [ -n "${9}" -a -z "${10}" ]; then # 550| macaddr="${9}" # 551|-> elif [ -n "${9}" -a -n "${10}" -a -n "${11}" -a -n "${12}" -a -n "${13}" -a -n "${14}" ]; then # 552| macaddr="${9}:${10}:${11}:${12}:${13}:${14}" # 553| fi Error: SHELLCHECK_WARNING (CWE-477): [#def42] /usr/lib/dracut/modules.d/45net-lib/net-lib.sh:551:44: warning[SC2166]: Prefer [ p ] && [ q ] as [ p -a q ] is not well defined. # 549| if [ -n "${9}" -a -z "${10}" ]; then # 550| macaddr="${9}" # 551|-> elif [ -n "${9}" -a -n "${10}" -a -n "${11}" -a -n "${12}" -a -n "${13}" -a -n "${14}" ]; then # 552| macaddr="${9}:${10}:${11}:${12}:${13}:${14}" # 553| fi Error: SHELLCHECK_WARNING (CWE-477): [#def43] /usr/lib/dracut/modules.d/45net-lib/net-lib.sh:551:58: warning[SC2166]: Prefer [ p ] && [ q ] as [ p -a q ] is not well defined. # 549| if [ -n "${9}" -a -z "${10}" ]; then # 550| macaddr="${9}" # 551|-> elif [ -n "${9}" -a -n "${10}" -a -n "${11}" -a -n "${12}" -a -n "${13}" -a -n "${14}" ]; then # 552| macaddr="${9}:${10}:${11}:${12}:${13}:${14}" # 553| fi Error: SHELLCHECK_WARNING (CWE-477): [#def44] /usr/lib/dracut/modules.d/45net-lib/net-lib.sh:551:72: warning[SC2166]: Prefer [ p ] && [ q ] as [ p -a q ] is not well defined. # 549| if [ -n "${9}" -a -z "${10}" ]; then # 550| macaddr="${9}" # 551|-> elif [ -n "${9}" -a -n "${10}" -a -n "${11}" -a -n "${12}" -a -n "${13}" -a -n "${14}" ]; then # 552| macaddr="${9}:${10}:${11}:${12}:${13}:${14}" # 553| fi Error: SHELLCHECK_WARNING (CWE-477): [#def45] /usr/lib/dracut/modules.d/45net-lib/net-lib.sh:551:86: warning[SC2166]: Prefer [ p ] && [ q ] as [ p -a q ] is not well defined. # 549| if [ -n "${9}" -a -z "${10}" ]; then # 550| macaddr="${9}" # 551|-> elif [ -n "${9}" -a -n "${10}" -a -n "${11}" -a -n "${12}" -a -n "${13}" -a -n "${14}" ]; then # 552| macaddr="${9}:${10}:${11}:${12}:${13}:${14}" # 553| fi Error: SHELLCHECK_WARNING (CWE-477): [#def46] /usr/lib/dracut/modules.d/45net-lib/net-lib.sh:556:28: warning[SC2166]: Prefer [ p ] && [ q ] as [ p -a q ] is not well defined. # 554| ;; # 555| *) # 556|-> if [ -n "${9}" -a -z "${10}" ]; then # 557| macaddr="${9}" # 558| elif [ -n "${9}" -a -n "${10}" -a -n "${11}" -a -n "${12}" -a -n "${13}" -a -n "${14}" ]; then Error: SHELLCHECK_WARNING (CWE-477): [#def47] /usr/lib/dracut/modules.d/45net-lib/net-lib.sh:558:30: warning[SC2166]: Prefer [ p ] && [ q ] as [ p -a q ] is not well defined. # 556| if [ -n "${9}" -a -z "${10}" ]; then # 557| macaddr="${9}" # 558|-> elif [ -n "${9}" -a -n "${10}" -a -n "${11}" -a -n "${12}" -a -n "${13}" -a -n "${14}" ]; then # 559| macaddr="${9}:${10}:${11}:${12}:${13}:${14}" # 560| fi Error: SHELLCHECK_WARNING (CWE-477): [#def48] /usr/lib/dracut/modules.d/45net-lib/net-lib.sh:558:44: warning[SC2166]: Prefer [ p ] && [ q ] as [ p -a q ] is not well defined. # 556| if [ -n "${9}" -a -z "${10}" ]; then # 557| macaddr="${9}" # 558|-> elif [ -n "${9}" -a -n "${10}" -a -n "${11}" -a -n "${12}" -a -n "${13}" -a -n "${14}" ]; then # 559| macaddr="${9}:${10}:${11}:${12}:${13}:${14}" # 560| fi Error: SHELLCHECK_WARNING (CWE-477): [#def49] /usr/lib/dracut/modules.d/45net-lib/net-lib.sh:558:58: warning[SC2166]: Prefer [ p ] && [ q ] as [ p -a q ] is not well defined. # 556| if [ -n "${9}" -a -z "${10}" ]; then # 557| macaddr="${9}" # 558|-> elif [ -n "${9}" -a -n "${10}" -a -n "${11}" -a -n "${12}" -a -n "${13}" -a -n "${14}" ]; then # 559| macaddr="${9}:${10}:${11}:${12}:${13}:${14}" # 560| fi Error: SHELLCHECK_WARNING (CWE-477): [#def50] /usr/lib/dracut/modules.d/45net-lib/net-lib.sh:558:72: warning[SC2166]: Prefer [ p ] && [ q ] as [ p -a q ] is not well defined. # 556| if [ -n "${9}" -a -z "${10}" ]; then # 557| macaddr="${9}" # 558|-> elif [ -n "${9}" -a -n "${10}" -a -n "${11}" -a -n "${12}" -a -n "${13}" -a -n "${14}" ]; then # 559| macaddr="${9}:${10}:${11}:${12}:${13}:${14}" # 560| fi Error: SHELLCHECK_WARNING (CWE-477): [#def51] /usr/lib/dracut/modules.d/45net-lib/net-lib.sh:558:86: warning[SC2166]: Prefer [ p ] && [ q ] as [ p -a q ] is not well defined. # 556| if [ -n "${9}" -a -z "${10}" ]; then # 557| macaddr="${9}" # 558|-> elif [ -n "${9}" -a -n "${10}" -a -n "${11}" -a -n "${12}" -a -n "${13}" -a -n "${14}" ]; then # 559| macaddr="${9}:${10}:${11}:${12}:${13}:${14}" # 560| fi Error: SHELLCHECK_WARNING (CWE-477): [#def52] /usr/lib/dracut/modules.d/50plymouth/plymouth-pretrigger.sh:21:37: warning[SC2166]: Prefer [ p ] && [ q ] as [ p -a q ] is not well defined. # 19| read -r consoledev rest < /sys/class/tty/console/active # 20| consoledev=${consoledev:-tty0} # 21|-> [ -x /lib/udev/console_init -a -e "/dev/$consoledev" ] && /lib/udev/console_init "/dev/$consoledev" # 22| plymouthd --attach-to-session --pid-file /run/plymouth/pid # 23| plymouth --show-splash 2>&1 | vinfo Error: SHELLCHECK_WARNING (CWE-477): [#def53] /usr/lib/dracut/modules.d/50plymouth/plymouth-pretrigger.sh:25:37: warning[SC2166]: Prefer [ p ] && [ q ] as [ p -a q ] is not well defined. # 23| plymouth --show-splash 2>&1 | vinfo # 24| # reset tty after plymouth messed with it # 25|-> [ -x /lib/udev/console_init -a -e "/dev/$consoledev" ] && /lib/udev/console_init "/dev/$consoledev" # 26| fi # 27| fi Error: SHELLCHECK_WARNING: [#def54] /usr/lib/dracut/modules.d/80lvmthinpool-monitor/start-thinpool-monitor.sh:12:43: warning[SC2319]: This $? refers to a condition, not a command. Assign to a variable to avoid it being overwritten. # 10| --nosuffix --noheadings -o vg_name,lv_name "$_device_path" 2> /dev/null) # 11| # 12|-> [ -n "$_lvm2_thin_device" ] && return $? # 13| } # 14| Error: SHELLCHECK_WARNING (CWE-477): [#def55] /usr/lib/dracut/modules.d/90crypt/crypt-lib.sh:151:17: warning[SC2166]: Prefer [ p ] && [ q ] as [ p -a q ] is not well defined. # 149| # 150| mount_point=$(mkuniqdir /mnt testdev) # 151|-> [ -n "$dev" -a -n "$*" ] || return 1 # 152| [ -d "$mount_point" ] || die 'Mount point does not exist!' # 153| Error: SHELLCHECK_WARNING (CWE-477): [#def56] /usr/lib/dracut/modules.d/90crypt/crypt-lib.sh:178:15: warning[SC2166]: Prefer [ p ] || [ q ] as [ p -o q ] is not well defined. # 176| # Returns true if /dev/dm-1 UUID starts with "123". # 177| match_dev() { # 178|-> [ -z "$1" -o "$1" = '*' ] && return 0 # 179| local devlist # 180| local dev Error: SHELLCHECK_WARNING (CWE-477): [#def57] /usr/lib/dracut/modules.d/90crypt/crypt-lib.sh:209:23: warning[SC2166]: Prefer [ p ] || [ q ] as [ p -o q ] is not well defined. # 207| local key_path # 208| # 209|-> [ -z "$keys_file" -o -z "$for_dev" ] && die 'getkey: wrong usage!' # 210| [ -f "$keys_file" ] || return 1 # 211| Error: SHELLCHECK_WARNING (CWE-477): [#def58] /usr/lib/dracut/modules.d/90crypt/cryptroot-ask.sh:33:25: warning[SC2166]: Prefer [ p ] || [ q ] as [ p -o q ] is not well defined. # 31| while read -r name dev luksfile luksoptions || [ -n "$name" ]; do # 32| # ignore blank lines and comments # 33|-> if [ -z "$name" -o "${name#\#}" != "$name" ]; then # 34| continue # 35| fi Error: SHELLCHECK_WARNING (CWE-477): [#def59] /usr/lib/dracut/modules.d/90crypt/cryptroot-ask.sh:140:21: warning[SC2166]: Prefer [ p ] && [ q ] as [ p -a q ] is not well defined. # 138| ask_passphrase=1 # 139| # 140|-> if [ -n "$luksfile" -a "$luksfile" != "none" -a -e "$luksfile" ]; then # 141| # shellcheck disable=SC2086 # 142| if readkey "$luksfile" / "$device" \ Error: SHELLCHECK_WARNING (CWE-477): [#def60] /usr/lib/dracut/modules.d/90crypt/cryptroot-ask.sh:140:46: warning[SC2166]: Prefer [ p ] && [ q ] as [ p -a q ] is not well defined. # 138| ask_passphrase=1 # 139| # 140|-> if [ -n "$luksfile" -a "$luksfile" != "none" -a -e "$luksfile" ]; then # 141| # shellcheck disable=SC2086 # 142| if readkey "$luksfile" / "$device" \ Error: SHELLCHECK_WARNING (CWE-477): [#def61] /usr/lib/dracut/modules.d/90crypt/cryptroot-ask.sh:190:28: warning[SC2166]: Prefer [ p ] && [ q ] as [ p -a q ] is not well defined. # 188| fi # 189| # 190|-> if [ "$is_keysource" -ne 0 -a "${luksname##luks-}" != "$luksname" ]; then # 191| luks_close="$(command -v cryptsetup) close" # 192| { Error: SHELLCHECK_WARNING (CWE-477): [#def62] /usr/lib/dracut/modules.d/90crypt/probe-keydev.sh:9:21: warning[SC2166]: Prefer [ p ] || [ q ] as [ p -o q ] is not well defined. # 7| luksdev="$3" # 8| # 9|-> [ -z "$real_keydev" -o -z "$keypath" ] && die 'probe-keydev: wrong usage!' # 10| [ -z "$luksdev" ] && luksdev='*' # 11| Error: SHELLCHECK_WARNING (CWE-477): [#def63] /usr/lib/dracut/modules.d/90dmraid/dmraid.sh:18:36: warning[SC2166]: Prefer [ p ] || [ q ] as [ p -o q ] is not well defined. # 16| SETS=$(dmraid -c -s) # 17| # 18|-> if [ "$SETS" = "no raid disks" -o "$SETS" = "no raid sets" ]; then # 19| return # 20| fi Error: SHELLCHECK_WARNING (CWE-477): [#def64] /usr/lib/dracut/modules.d/90dmsquash-live/apply-live-updates.sh:3:57: warning[SC2166]: Prefer [ p ] || [ q ] as [ p -o q ] is not well defined. # 1| #!/usr/bin/sh # 2| # 3|-> if [ -h /dev/root ] && [ -d /run/initramfs/live/updates -o -d /updates ]; then # 4| info "Applying updates to live image..." # 5| mount -o bind /run "$NEWROOT"/run Error: SHELLCHECK_WARNING (CWE-477): [#def65] /usr/lib/dracut/modules.d/90dmsquash-live/apply-live-updates.sh:19:41: warning[SC2166]: Prefer [ p ] || [ q ] as [ p -o q ] is not well defined. # 17| # release resources on iso-scan boots with rd.live.ram # 18| if [ -d /run/initramfs/isoscan ] \ # 19|-> && [ -f /run/initramfs/squashed.img -o -f /run/initramfs/rootfs.img ]; then # 20| umount --detach-loop /run/initramfs/live # 21| umount /run/initramfs/isoscan Error: SHELLCHECK_WARNING (CWE-477): [#def66] /usr/lib/dracut/modules.d/90dmsquash-live/dmsquash-live-root.sh:70:28: warning[SC2166]: Prefer [ p ] || [ q ] as [ p -o q ] is not well defined. # 68| # CD/DVD media check # 69| [ -b "$check_dev" ] && fs=$(det_fs "$check_dev") # 70|-> if [ "$fs" = "iso9660" -o "$fs" = "udf" ]; then # 71| check="yes" # 72| fi Error: SHELLCHECK_WARNING (CWE-477): [#def67] /usr/lib/dracut/modules.d/90dmsquash-live/dmsquash-live-root.sh:151:25: warning[SC2166]: Prefer [ p ] || [ q ] as [ p -o q ] is not well defined. # 149| fi # 150| # 151|-> if [ -z "$pathspec" -o "$pathspec" = "auto" ]; then # 152| pathspec="/${live_dir}/overlay-$l-$u" # 153| elif ! str_starts "$pathspec" "/"; then Error: SHELLCHECK_WARNING (CWE-477): [#def68] /usr/lib/dracut/modules.d/90dmsquash-live/dmsquash-live-root.sh:159:22: warning[SC2166]: Prefer [ p ] && [ q ] as [ p -a q ] is not well defined. # 157| # 158| # need to know where to look for the overlay # 159|-> if [ -z "$setup" -a -n "$devspec" -a -n "$pathspec" -a -n "$overlay" ]; then # 160| mkdir -m 0755 -p /run/initramfs/overlayfs # 161| if ismounted "$devspec"; then Error: SHELLCHECK_WARNING (CWE-477): [#def69] /usr/lib/dracut/modules.d/90dmsquash-live/dmsquash-live-root.sh:159:39: warning[SC2166]: Prefer [ p ] && [ q ] as [ p -a q ] is not well defined. # 157| # 158| # need to know where to look for the overlay # 159|-> if [ -z "$setup" -a -n "$devspec" -a -n "$pathspec" -a -n "$overlay" ]; then # 160| mkdir -m 0755 -p /run/initramfs/overlayfs # 161| if ismounted "$devspec"; then Error: SHELLCHECK_WARNING (CWE-477): [#def70] /usr/lib/dracut/modules.d/90dmsquash-live/dmsquash-live-root.sh:159:57: warning[SC2166]: Prefer [ p ] && [ q ] as [ p -a q ] is not well defined. # 157| # 158| # need to know where to look for the overlay # 159|-> if [ -z "$setup" -a -n "$devspec" -a -n "$pathspec" -a -n "$overlay" ]; then # 160| mkdir -m 0755 -p /run/initramfs/overlayfs # 161| if ismounted "$devspec"; then Error: SHELLCHECK_WARNING (CWE-477): [#def71] /usr/lib/dracut/modules.d/90dmsquash-live/dmsquash-live-root.sh:169:51: warning[SC2166]: Prefer [ p ] && [ q ] as [ p -a q ] is not well defined. # 167| mount -n -t auto "$devspec" /run/initramfs/overlayfs || : # 168| fi # 169|-> if [ -f /run/initramfs/overlayfs$pathspec -a -w /run/initramfs/overlayfs$pathspec ]; then # 170| OVERLAY_LOOPDEV=$(losetup -f --show ${readonly_overlay:+-r} /run/initramfs/overlayfs$pathspec) # 171| over=$OVERLAY_LOOPDEV Error: SHELLCHECK_WARNING (CWE-477): [#def72] /usr/lib/dracut/modules.d/90dmsquash-live/dmsquash-live-root.sh:221:22: warning[SC2166]: Prefer [ p ] || [ q ] as [ p -o q ] is not well defined. # 219| fi # 220| # 221|-> if [ -z "$setup" -o -n "$readonly_overlay" ]; then # 222| if [ -n "$setup" ]; then # 223| warn "Using temporary overlay." Error: SHELLCHECK_WARNING (CWE-477): [#def73] /usr/lib/dracut/modules.d/90dmsquash-live/dmsquash-live-root.sh:224:30: warning[SC2166]: Prefer [ p ] && [ q ] as [ p -a q ] is not well defined. # 222| if [ -n "$setup" ]; then # 223| warn "Using temporary overlay." # 224|-> elif [ -n "$devspec" -a -n "$pathspec" ]; then # 225| [ -z "$m" ] \ # 226| && m=' Unable to find a persistent overlay; using a temporary one.' Error: SHELLCHECK_WARNING (CWE-477): [#def74] /usr/lib/dracut/modules.d/90dmsquash-live/dmsquash-live-root.sh:268:30: warning[SC2166]: Prefer [ p ] && [ q ] as [ p -a q ] is not well defined. # 266| else # 267| dd if=/dev/null of=/overlay bs=1024 count=1 seek=$((overlay_size * 1024)) 2> /dev/null # 268|-> if [ -n "$setup" -a -n "$readonly_overlay" ]; then # 269| RO_OVERLAY_LOOPDEV=$(losetup -f --show /overlay) # 270| over=$RO_OVERLAY_LOOPDEV Error: SHELLCHECK_WARNING (CWE-477): [#def75] /usr/lib/dracut/modules.d/90dmsquash-live/dmsquash-live-root.sh:387:25: warning[SC2166]: Prefer [ p ] && [ q ] as [ p -a q ] is not well defined. # 385| # For writable DM images... # 386| readonly_base=1 # 387|-> if [ -z "$SQUASHED" -a -n "$live_ram" -a -z "$overlayfs" ] \ # 388| || [ -n "$writable_fsimg" ] \ # 389| || [ "$overlay" = none -o "$overlay" = None -o "$overlay" = NONE ]; then Error: SHELLCHECK_WARNING (CWE-477): [#def76] /usr/lib/dracut/modules.d/90dmsquash-live/dmsquash-live-root.sh:387:43: warning[SC2166]: Prefer [ p ] && [ q ] as [ p -a q ] is not well defined. # 385| # For writable DM images... # 386| readonly_base=1 # 387|-> if [ -z "$SQUASHED" -a -n "$live_ram" -a -z "$overlayfs" ] \ # 388| || [ -n "$writable_fsimg" ] \ # 389| || [ "$overlay" = none -o "$overlay" = None -o "$overlay" = NONE ]; then Error: SHELLCHECK_WARNING (CWE-477): [#def77] /usr/lib/dracut/modules.d/90dmsquash-live/dmsquash-live-root.sh:389:32: warning[SC2166]: Prefer [ p ] || [ q ] as [ p -o q ] is not well defined. # 387| if [ -z "$SQUASHED" -a -n "$live_ram" -a -z "$overlayfs" ] \ # 388| || [ -n "$writable_fsimg" ] \ # 389|-> || [ "$overlay" = none -o "$overlay" = None -o "$overlay" = NONE ]; then # 390| if [ -z "$readonly_overlay" ]; then # 391| unset readonly_base Error: SHELLCHECK_WARNING (CWE-477): [#def78] /usr/lib/dracut/modules.d/90dmsquash-live/dmsquash-live-root.sh:389:53: warning[SC2166]: Prefer [ p ] || [ q ] as [ p -o q ] is not well defined. # 387| if [ -z "$SQUASHED" -a -n "$live_ram" -a -z "$overlayfs" ] \ # 388| || [ -n "$writable_fsimg" ] \ # 389|-> || [ "$overlay" = none -o "$overlay" = None -o "$overlay" = NONE ]; then # 390| if [ -z "$readonly_overlay" ]; then # 391| unset readonly_base Error: SHELLCHECK_WARNING (CWE-477): [#def79] /usr/lib/dracut/modules.d/90livenet/livenetroot.sh:50:24: warning[SC2166]: Prefer [ p ] && [ q ] as [ p -a q ] is not well defined. # 48| fi # 49| # 50|-> if [ -n "$imgfile" -a -s "$imgfile" ]; then # 51| break # 52| else Error: SHELLCHECK_WARNING (CWE-477): [#def80] /usr/lib/dracut/modules.d/90multipath/module-setup.sh:56:28: warning[SC2166]: Prefer [ p ] || [ q ] as [ p -o q ] is not well defined. # 54| local _funcs='scsi_register_device_handler|dm_dirty_log_type_register|dm_register_path_selector|dm_register_target' # 55| # 56|-> if [ "$_arch" = "s390" -o "$_arch" = "s390x" ]; then # 57| _s390drivers="=drivers/s390/scsi" # 58| fi Error: SHELLCHECK_WARNING (CWE-457): [#def81] /usr/lib/dracut/modules.d/91tpm2-tss/module-setup.sh:35:10: warning[SC2154]: sysusers is referenced but not assigned. # 33| # 34| inst_multiple -o \ # 35|-> "$sysusers"/tpm2-tss.conf \ # 36| "$tmpfilesdir"/tpm2-tss-fapi.conf \ # 37| "$udevrulesdir"/60-tpm-udev.rules \ Error: SHELLCHECK_WARNING (CWE-477): [#def82] /usr/lib/dracut/modules.d/95cifs/cifs-lib.sh:33:24: warning[SC2166]: Prefer [ p ] || [ q ] as [ p -o q ] is not well defined. # 31| server=${server%/*} # 32| # 33|-> if [ ! "$cifsuser" -o ! "$cifspass" ]; then # 34| die "For CIFS support you need to specify a cifsuser and cifspass either in the cifsuser and cifspass commandline parameters or in the root= CIFS URL." # 35| fi Error: SHELLCHECK_WARNING (CWE-477): [#def83] /usr/lib/dracut/modules.d/95fcoe/fcoe-edd.sh:37:31: warning[SC2166]: Prefer [ p ] && [ q ] as [ p -a q ] is not well defined. # 35| for nic in "${disk}"/pci_dev/net/*; do # 36| [ -d "$nic" ] || continue # 37|-> if [ -n "${dev_port}" -a -e "${nic}/dev_port" ]; then # 38| if [ "$(cat "${nic}"/dev_port)" -ne "${dev_port}" ]; then # 39| continue Error: SHELLCHECK_WARNING (CWE-477): [#def84] /usr/lib/dracut/modules.d/95fcoe/fcoe-up.sh:14:11: warning[SC2166]: Prefer [ p ] || [ q ] as [ p -o q ] is not well defined. # 12| # 13| # Huh? Missing arguments ?? # 14|-> [ -z "$1" -o -z "$2" ] && exit 1 # 15| # 16| netif=$1 Error: SHELLCHECK_WARNING (CWE-477): [#def85] /usr/lib/dracut/modules.d/95fcoe/parse-fcoe.sh:75:33: warning[SC2166]: Prefer [ p ] && [ q ] as [ p -a q ] is not well defined. # 73| esac # 74| # 75|-> if [ "$fcoe_dcb" != "nodcb" -a "$fcoe_dcb" != "dcb" ]; then # 76| warn "Invalid FCoE DCB option: $fcoe_dcb" # 77| fi Error: SHELLCHECK_WARNING (CWE-477): [#def86] /usr/lib/dracut/modules.d/95fcoe/parse-fcoe.sh:84:31: warning[SC2166]: Prefer [ p ] && [ q ] as [ p -a q ] is not well defined. # 82| fi # 83| # 84|-> if [ -z "$fcoe_interface" -a -z "$fcoe_mac" ]; then # 85| warn "fcoe: Neither interface nor MAC specified for fcoe=$fcoe" # 86| return 1 Error: SHELLCHECK_WARNING (CWE-457): [#def87] /usr/lib/dracut/modules.d/95hwdb/module-setup.sh:15:15: warning[SC2154]: udevconfdir is referenced but not assigned. # 13| # Follow the same priority as `systemd-hwdb`; `/etc` is the default # 14| # and `/usr/lib` an alternative location. # 15|-> hwdb_bin="${udevconfdir}"/hwdb.bin # 16| # 17| if [[ ! -r ${hwdb_bin} ]]; then Error: SHELLCHECK_WARNING (CWE-457): [#def88] /usr/lib/dracut/modules.d/95hwdb/module-setup.sh:18:19: warning[SC2154]: udevdir is referenced but not assigned. # 16| # 17| if [[ ! -r ${hwdb_bin} ]]; then # 18|-> hwdb_bin="${udevdir}"/hwdb.bin # 19| fi # 20| Error: SHELLCHECK_WARNING: [#def89] /usr/lib/dracut/modules.d/95iscsi/iscsiroot.sh:232:129: warning[SC2319]: This $? refers to a condition, not a command. Assign to a variable to avoid it being overwritten. # 230| done # 231| }) # 232|-> [ -z "$targets" ] && warn "Target discovery to $iscsi_target_ip:${iscsi_target_port:+$iscsi_target_port} failed with status $?" && return 1 # 233| # 234| found= Error: SHELLCHECK_WARNING (CWE-477): [#def90] /usr/lib/dracut/modules.d/95iscsi/module-setup.sh:112:30: warning[SC2166]: Prefer [ p ] && [ q ] as [ p -a q ] is not well defined. # 110| ip_params_for_remote_addr "$iscsi_address" # 111| # 112|-> if [ -n "$iscsi_address" -a -n "$iscsi_targetname" ]; then # 113| if [ -n "$iscsi_port" -a "$iscsi_port" -eq 3260 ]; then # 114| iscsi_port= Error: SHELLCHECK_WARNING (CWE-477): [#def91] /usr/lib/dracut/modules.d/95iscsi/module-setup.sh:113:31: warning[SC2166]: Prefer [ p ] && [ q ] as [ p -a q ] is not well defined. # 111| # 112| if [ -n "$iscsi_address" -a -n "$iscsi_targetname" ]; then # 113|-> if [ -n "$iscsi_port" -a "$iscsi_port" -eq 3260 ]; then # 114| iscsi_port= # 115| fi Error: SHELLCHECK_WARNING (CWE-477): [#def92] /usr/lib/dracut/modules.d/95iscsi/module-setup.sh:116:30: warning[SC2166]: Prefer [ p ] && [ q ] as [ p -a q ] is not well defined. # 114| iscsi_port= # 115| fi # 116|-> if [ -n "$iscsi_lun" -a "$iscsi_lun" -eq 0 ]; then # 117| iscsi_lun= # 118| fi Error: SHELLCHECK_WARNING (CWE-477): [#def93] /usr/lib/dracut/modules.d/95iscsi/module-setup.sh:166:28: warning[SC2166]: Prefer [ p ] || [ q ] as [ p -o q ] is not well defined. # 164| hostonly="" instmods iscsi_tcp iscsi_ibft crc32c iscsi_boot_sysfs 8021q # 165| # 166|-> if [ "$_arch" = "s390" -o "$_arch" = "s390x" ]; then # 167| _s390drivers="=drivers/s390/scsi" # 168| fi Error: SHELLCHECK_WARNING (CWE-477): [#def94] /usr/lib/dracut/modules.d/95nbd/nbdroot.sh:63:25: warning[SC2166]: Prefer [ p ] || [ q ] as [ p -o q ] is not well defined. # 61| break # 62| fi # 63|-> if [ -z "${f%bs=*}" -o -z "${f%timeout=*}" ]; then # 64| preopts="$preopts $f" # 65| continue Error: SHELLCHECK_WARNING (CWE-477): [#def95] /usr/lib/dracut/modules.d/95nbd/nbdroot.sh:78:22: warning[SC2166]: Prefer [ p ] || [ q ] as [ p -o q ] is not well defined. # 76| break # 77| fi # 78|-> if [ "$f" = "ro" -o "$f" = "rw" ]; then # 79| nbdrw=$f # 80| continue Error: SHELLCHECK_WARNING (CWE-457): [#def96] /usr/lib/dracut/modules.d/95nbd/nbdroot.sh:99:7: warning[SC2154]: root is referenced but not assigned (did you mean 'nroot'?). # 97| # If we didn't get a root= on the command line, then we need to # 98| # add the udev rules for mounting the nbd0 device # 99|-> if [ "$root" = "block:/dev/root" -o "$root" = "dhcp" ]; then # 100| printf 'KERNEL=="nbd0", ENV{DEVTYPE}!="partition", ENV{ID_FS_TYPE}=="?*", SYMLINK+="root"\n' > /etc/udev/rules.d/99-nbd-root.rules # 101| udevadm control --reload Error: SHELLCHECK_WARNING (CWE-477): [#def97] /usr/lib/dracut/modules.d/95nbd/nbdroot.sh:99:34: warning[SC2166]: Prefer [ p ] || [ q ] as [ p -o q ] is not well defined. # 97| # If we didn't get a root= on the command line, then we need to # 98| # add the udev rules for mounting the nbd0 device # 99|-> if [ "$root" = "block:/dev/root" -o "$root" = "dhcp" ]; then # 100| printf 'KERNEL=="nbd0", ENV{DEVTYPE}!="partition", ENV{ID_FS_TYPE}=="?*", SYMLINK+="root"\n' > /etc/udev/rules.d/99-nbd-root.rules # 101| udevadm control --reload Error: SHELLCHECK_WARNING (CWE-277): [#def98] /usr/lib/dracut/modules.d/95nfs/nfsroot-cleanup.sh:20:18: warning[SC2174]: When used with -p, -m only applies to the deepest directory. # 18| # try to create the destination directory # 19| [ -d "$NEWROOT"/$rpcpipefspath ] \ # 20|-> || mkdir -m 0755 -p "$NEWROOT"/$rpcpipefspath 2> /dev/null # 21| # 22| if [ -d "$NEWROOT"/$rpcpipefspath ]; then Error: SHELLCHECK_WARNING (CWE-477): [#def99] /usr/lib/dracut/modules.d/95resume/resume.sh:5:15: warning[SC2166]: Prefer [ p ] && [ q ] as [ p -a q ] is not well defined. # 3| PATH=/usr/sbin:/usr/bin:/sbin:/bin # 4| # 5|-> [ -s /.resume -a -b "$resume" ] && { # 6| # First try user level resume; it offers splash etc # 7| case "$splash" in Error: SHELLCHECK_WARNING (CWE-457): [#def100] /usr/lib/dracut/modules.d/95resume/resume.sh:5:22: warning[SC2154]: resume is referenced but not assigned. # 3| PATH=/usr/sbin:/usr/bin:/sbin:/bin # 4| # 5|-> [ -s /.resume -a -b "$resume" ] && { # 6| # First try user level resume; it offers splash etc # 7| case "$splash" in Error: SHELLCHECK_WARNING (CWE-477): [#def101] /usr/lib/dracut/modules.d/95rootfs-block/module-setup.sh:43:23: warning[SC2166]: Prefer [ p ] && [ q ] as [ p -a q ] is not well defined. # 41| fi # 42| # 43|-> if [ -n "$_block" -a -b "$_dev" ]; then # 44| printf " root=%s" "$(shorten_persistent_dev "$(get_persistent_dev "$_dev")")" # 45| fi Error: SHELLCHECK_WARNING (CWE-477): [#def102] /usr/lib/dracut/modules.d/95rootfs-block/mount-root.sh:101:33: warning[SC2166]: Prefer [ p ] && [ q ] as [ p -a q ] is not well defined. # 99| # 100| if ! getargbool 0 ro && fsck_able "$rootfs" \ # 101|-> && [ "$rootfsck" != "0" -a -z "$fastboot" ] \ # 102| && ! strstr "${rflags}" _netdev \ # 103| && ! getargbool 0 rd.skipfsck; then Error: SHELLCHECK_WARNING (CWE-477): [#def103] /usr/lib/dracut/modules.d/95rootfs-block/mount-root.sh:124:17: warning[SC2166]: Prefer [ p ] && [ q ] as [ p -a q ] is not well defined. # 122| } # 123| # 124|-> if [ -n "$root" -a -z "${root%%block:*}" ]; then # 125| mount_root # 126| fi Error: SHELLCHECK_WARNING (CWE-477): [#def104] /usr/lib/dracut/modules.d/95virtfs/mount-virtfs.sh:71:17: warning[SC2166]: Prefer [ p ] && [ q ] as [ p -a q ] is not well defined. # 69| } # 70| # 71|-> if [ -n "$root" -a -z "${root%%virtfs:*}" ]; then # 72| mount_root # 73| fi Error: SHELLCHECK_WARNING (CWE-457): [#def105] /usr/lib/dracut/modules.d/95virtiofs/mount-virtiofs.sh:5:7: warning[SC2154]: fstype is referenced but not assigned. # 3| type ismounted > /dev/null 2>&1 || . /lib/dracut-lib.sh # 4| # 5|-> if [ "${fstype}" = "virtiofs" -o "${root%%:*}" = "virtiofs" ]; then # 6| if ! load_fstype virtiofs; then # 7| die "virtiofs is required but not available." Error: SHELLCHECK_WARNING (CWE-477): [#def106] /usr/lib/dracut/modules.d/95virtiofs/mount-virtiofs.sh:5:31: warning[SC2166]: Prefer [ p ] || [ q ] as [ p -o q ] is not well defined. # 3| type ismounted > /dev/null 2>&1 || . /lib/dracut-lib.sh # 4| # 5|-> if [ "${fstype}" = "virtiofs" -o "${root%%:*}" = "virtiofs" ]; then # 6| if ! load_fstype virtiofs; then # 7| die "virtiofs is required but not available." Error: SHELLCHECK_WARNING (CWE-457): [#def107] /usr/lib/dracut/modules.d/95virtiofs/mount-virtiofs.sh:5:35: warning[SC2154]: root is referenced but not assigned. # 3| type ismounted > /dev/null 2>&1 || . /lib/dracut-lib.sh # 4| # 5|-> if [ "${fstype}" = "virtiofs" -o "${root%%:*}" = "virtiofs" ]; then # 6| if ! load_fstype virtiofs; then # 7| die "virtiofs is required but not available." Error: SHELLCHECK_WARNING (CWE-457): [#def108] /usr/lib/dracut/modules.d/95virtiofs/parse-virtiofs.sh:6:7: warning[SC2154]: fstype is referenced but not assigned. # 4| # root=virtiofs:<tag> # 5| # 6|-> if [ "${fstype}" = "virtiofs" -o "${root%%:*}" = "virtiofs" ]; then # 7| # shellcheck disable=SC2034 # 8| rootok=1 Error: SHELLCHECK_WARNING (CWE-477): [#def109] /usr/lib/dracut/modules.d/95virtiofs/parse-virtiofs.sh:6:31: warning[SC2166]: Prefer [ p ] || [ q ] as [ p -o q ] is not well defined. # 4| # root=virtiofs:<tag> # 5| # 6|-> if [ "${fstype}" = "virtiofs" -o "${root%%:*}" = "virtiofs" ]; then # 7| # shellcheck disable=SC2034 # 8| rootok=1 Error: SHELLCHECK_WARNING (CWE-457): [#def110] /usr/lib/dracut/modules.d/95virtiofs/parse-virtiofs.sh:6:35: warning[SC2154]: root is referenced but not assigned. # 4| # root=virtiofs:<tag> # 5| # 6|-> if [ "${fstype}" = "virtiofs" -o "${root%%:*}" = "virtiofs" ]; then # 7| # shellcheck disable=SC2034 # 8| rootok=1 Error: SHELLCHECK_WARNING: [#def111] /usr/lib/dracut/modules.d/98dracut-systemd/dracut-cmdline-ask.sh:17:15: warning[SC3045]: In POSIX sh, read -p is undefined. # 15| echo # 16| echo "Enter additional kernel command line parameter (end with ctrl-d or .)" # 17|-> while read -r -p "> " ${BASH:+-e} line || [ -n "$line" ]; do # 18| [ "$line" = "." ] && break # 19| [ -n "$line" ] && printf -- "%s\n" "$line" >> /etc/cmdline.d/99-cmdline-ask.conf Error: SHELLCHECK_WARNING (CWE-477): [#def112] /usr/lib/dracut/modules.d/98selinux/selinux-loadpolicy.sh:21:45: warning[SC2166]: Prefer [ p ] || [ q ] as [ p -o q ] is not well defined. # 19| # 20| # Attempt to load SELinux Policy # 21|-> if [ -x "$NEWROOT/usr/sbin/load_policy" -o -x "$NEWROOT/sbin/load_policy" ]; then # 22| local ret=0 # 23| local out Error: SHELLCHECK_WARNING (CWE-477): [#def113] /usr/lib/dracut/modules.d/98selinux/selinux-loadpolicy.sh:44:25: warning[SC2166]: Prefer [ p ] || [ q ] as [ p -o q ] is not well defined. # 42| fi # 43| # 44|-> if [ $ret -eq 0 -o $ret -eq 2 ]; then # 45| # If machine requires a relabel, force to permissive mode # 46| [ -e "$NEWROOT"/.autorelabel ] && LANG=C /usr/sbin/setenforce 0 Error: SHELLCHECK_WARNING (CWE-477): [#def114] /usr/lib/dracut/modules.d/98selinux/selinux-loadpolicy.sh:54:25: warning[SC2166]: Prefer [ p ] || [ q ] as [ p -o q ] is not well defined. # 52| # 53| warn "Initial SELinux policy load failed." # 54|-> if [ $ret -eq 3 -o $permissive -eq 0 ]; then # 55| warn "Machine in enforcing mode." # 56| warn "Not continuing" Error: SHELLCHECK_WARNING (CWE-477): [#def115] /usr/lib/dracut/modules.d/98selinux/selinux-loadpolicy.sh:61:30: warning[SC2166]: Prefer [ p ] && [ q ] as [ p -a q ] is not well defined. # 59| fi # 60| return 0 # 61|-> elif [ $permissive -eq 0 -a "$SELINUX" != "disabled" ]; then # 62| warn "Machine in enforcing mode and cannot execute load_policy." # 63| warn "To disable selinux, add selinux=0 to the kernel command line." Error: SHELLCHECK_WARNING (CWE-477): [#def116] /usr/lib/dracut/modules.d/99base/dracut-dev-lib.sh:33:23: warning[SC2166]: Prefer [ p ] || [ q ] as [ p -o q ] is not well defined. # 31| fi # 32| # 33|-> if [ "$dev" = "/" -o -z "$dev" ]; then # 34| printf -- "-" # 35| return 0 Error: SHELLCHECK_WARNING (CWE-477): [#def117] /usr/lib/dracut/modules.d/99base/dracut-lib.sh:40:15: warning[SC2166]: Prefer [ p ] && [ q ] as [ p -a q ] is not well defined. # 38| strglob() { # 39| # shellcheck disable=SC2295 # 40|-> [ -n "$1" -a -z "${1##$2}" ] # 41| } # 42| Error: SHELLCHECK_WARNING (CWE-477): [#def118] /usr/lib/dracut/modules.d/99base/dracut-lib.sh:48:15: warning[SC2166]: Prefer [ p ] && [ q ] as [ p -a q ] is not well defined. # 46| strglobin() { # 47| # shellcheck disable=SC2295 # 48|-> [ -n "$1" -a -z "${1##*$2*}" ] # 49| } # 50| Error: SHELLCHECK_WARNING (CWE-477): [#def119] /usr/lib/dracut/modules.d/99base/dracut-lib.sh:357:23: warning[SC2166]: Prefer [ p ] && [ q ] as [ p -a q ] is not well defined. # 355| local tmp # 356| # 357|-> while [ -n "$str" -a "$#" -gt 1 ]; do # 358| tmp="${str%%"$sep"*}" # 359| eval "$1='${tmp}'" Error: SHELLCHECK_WARNING (CWE-477): [#def120] /usr/lib/dracut/modules.d/99base/dracut-lib.sh:364:17: warning[SC2166]: Prefer [ p ] && [ q ] as [ p -a q ] is not well defined. # 362| shift # 363| done # 364|-> [ -n "$str" -a -n "$1" ] && eval "$1='$str'" # 365| debug_on # 366| return 0 Error: SHELLCHECK_WARNING: [#def121] /usr/lib/dracut/modules.d/99base/init.sh:112:19: warning[SC3045]: In POSIX sh, read -p is undefined. # 110| if getarg "rd.cmdline=ask"; then # 111| echo "Enter additional kernel command line parameter (end with ctrl-d or .)" # 112|-> while read -r -p "> " ${BASH:+-e} line || [ -n "$line" ]; do # 113| [ "$line" = "." ] && break # 114| echo "$line" >> /etc/cmdline.d/99-cmdline-ask.conf
analyzer-version-clippy | 1.82.0 |
analyzer-version-cppcheck | 2.16.0 |
analyzer-version-gcc | 14.2.1 |
analyzer-version-gcc-analyzer | 15.0.0 |
analyzer-version-shellcheck | 0.10.0 |
analyzer-version-unicontrol | 0.0.2 |
diffbase-analyzer-version-clippy | 1.82.0 |
diffbase-analyzer-version-cppcheck | 2.16.0 |
diffbase-analyzer-version-gcc | 14.2.1 |
diffbase-analyzer-version-gcc-analyzer | 15.0.0 |
diffbase-analyzer-version-shellcheck | 0.10.0 |
diffbase-analyzer-version-unicontrol | 0.0.2 |
diffbase-enabled-plugins | clippy, cppcheck, gcc, shellcheck, unicontrol |
diffbase-exit-code | 0 |
diffbase-host | ip-172-16-1-189.us-west-2.compute.internal |
diffbase-mock-config | fedora-rawhide-gcc-latest-x86_64 |
diffbase-project-name | dracut-103-1.fc42 |
diffbase-store-results-to | /tmp/tmpvfbncm_2/dracut-103-1.fc42.tar.xz |
diffbase-time-created | 2024-11-12 23:45:26 |
diffbase-time-finished | 2024-11-12 23:47:23 |
diffbase-tool | csmock |
diffbase-tool-args | '/usr/bin/csmock' '-r' 'fedora-rawhide-gcc-latest-x86_64' '-t' 'clippy,cppcheck,gcc,unicontrol,shellcheck' '-o' '/tmp/tmpvfbncm_2/dracut-103-1.fc42.tar.xz' '--gcc-analyze' '--unicontrol-notests' '--unicontrol-bidi-only' '--install=gcc-latest' '--gcc-analyzer-bin=/opt/gcc-latest/bin/gcc' '/tmp/tmpvfbncm_2/dracut-103-1.fc42.src.rpm' |
diffbase-tool-version | csmock-3.7.1.20241107.094801.gb3f0f26.pr_192-1.el9 |
enabled-plugins | clippy, cppcheck, gcc, shellcheck, unicontrol |
exit-code | 0 |
host | ip-172-16-1-189.us-west-2.compute.internal |
mock-config | fedora-rawhide-gcc-latest-x86_64 |
project-name | dracut-102-3.fc41 |
store-results-to | /tmp/tmp9zci55xy/dracut-102-3.fc41.tar.xz |
time-created | 2024-11-12 23:42:43 |
time-finished | 2024-11-12 23:45:02 |
title | Fixed findings |
tool | csmock |
tool-args | '/usr/bin/csmock' '-r' 'fedora-rawhide-gcc-latest-x86_64' '-t' 'clippy,cppcheck,gcc,unicontrol,shellcheck' '-o' '/tmp/tmp9zci55xy/dracut-102-3.fc41.tar.xz' '--gcc-analyze' '--unicontrol-notests' '--unicontrol-bidi-only' '--install=gcc-latest' '--gcc-analyzer-bin=/opt/gcc-latest/bin/gcc' '/tmp/tmp9zci55xy/dracut-102-3.fc41.src.rpm' |
tool-version | csmock-3.7.1.20241107.094801.gb3f0f26.pr_192-1.el9 |