]> git.ipfire.org Git - thirdparty/dracut-ng.git/commitdiff
fix(znet): quote initdir variable
authorBenjamin Drung <benjamin.drung@canonical.com>
Sat, 15 Jun 2024 13:11:22 +0000 (15:11 +0200)
committerLaszlo Gombos <laszlo.gombos@gmail.com>
Sat, 15 Jun 2024 13:34:19 +0000 (09:34 -0400)
shellcheck complains about SC2086 (info): Double quote to prevent
globbing and word splitting.

The variable `initdir` refers to a path and therefore is safe to be
quoted.

Signed-off-by: Benjamin Drung <benjamin.drung@canonical.com>
modules.d/95znet/module-setup.sh

index c2f5ab9ccf760b24f45282479da52af0fafc7102..3b5ed60f71668ac32d14314938a8c9cd6dfe1e12 100755 (executable)
@@ -45,14 +45,12 @@ install() {
         # shellcheck disable=SC2155
         local _nullglob=$(shopt -p nullglob)
         shopt -u nullglob
-        # shellcheck disable=SC2086
         readarray -t _array < <(
-            ls -1 $initdir/etc/udev/rules.d/41-*.rules 2> /dev/null
+            ls -1 "$initdir"/etc/udev/rules.d/41-*.rules 2> /dev/null
         )
         [[ ${#_array[@]} -gt 0 ]] && mark_hostonly "${_array[@]#$initdir}"
-        # shellcheck disable=SC2086
         readarray -t _array < <(
-            ls -1 $initdir/etc/modprobe.d/s390x-*.conf 2> /dev/null
+            ls -1 "$initdir"/etc/modprobe.d/s390x-*.conf 2> /dev/null
         )
         [[ ${#_array[@]} -gt 0 ]] && mark_hostonly "${_array[@]#$initdir}"
         $_nullglob