From: Harald Hoyer Date: Fri, 12 Feb 2021 12:26:10 +0000 (+0100) Subject: fix: shellcheck for modules.d/02caps/caps.sh X-Git-Tag: 052~63 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=4e3133e622779b96d8dcc9a06a15000833e92c0e;p=thirdparty%2Fdracut.git fix: shellcheck for modules.d/02caps/caps.sh --- diff --git a/modules.d/02caps/caps.sh b/modules.d/02caps/caps.sh index ee91dce42..54aabe47e 100755 --- a/modules.d/02caps/caps.sh +++ b/modules.d/02caps/caps.sh @@ -4,28 +4,29 @@ capsmode=$(getarg rd.caps) if [ "$capsmode" = "1" ]; then CAPS_INIT_DROP=$(getarg rd.caps.initdrop=) + # shellcheck disable=SC2016 CAPS_USERMODEHELPER_BSET=$(capsh --drop="$CAPS_INIT_DROP" -- -c 'while read a b || [ -n "$a" ]; do [ "$a" = "CapBnd:" ] && echo $((0x${b:$((${#b}-8)):8})) $((0x${b:$((${#b}-16)):8})) && break; done < /proc/self/status') CAPS_MODULES_DISABLED=$(getarg rd.caps.disablemodules=) CAPS_KEXEC_DISABLED=$(getarg rd.caps.disablekexec=) info "Loading CAPS_MODULES $CAPS_MODULES" - for i in $CAPS_MODULES;do modprobe $i 2>&1 >/dev/null | vinfo; done + for i in $CAPS_MODULES;do modprobe "$i" 2>&1 >/dev/null | vinfo; done if [ "$CAPS_MODULES_DISABLED" = "1" -a -e /proc/sys/kernel/modules_disabled ]; then info "Disabling module loading." - echo $CAPS_MODULES_DISABLED > /proc/sys/kernel/modules_disabled + echo "$CAPS_MODULES_DISABLED" > /proc/sys/kernel/modules_disabled fi if [ "$CAPS_KEXEC_DISABLED" = "1" -a -e /proc/sys/kernel/kexec_disabled ]; then info "Disabling kexec." - echo $CAPS_KEXEC_DISABLED > /proc/sys/kernel/kexec_disabled + echo "$CAPS_KEXEC_DISABLED" > /proc/sys/kernel/kexec_disabled fi info "CAPS_USERMODEHELPER_BSET=$CAPS_USERMODEHELPER_BSET" if [ -e /proc/sys/kernel/usermodehelper/bset ]; then info "Setting usermode helper bounding set." - echo $CAPS_USERMODEHELPER_BSET > /proc/sys/kernel/usermodehelper/bset - echo $CAPS_USERMODEHELPER_BSET > /proc/sys/kernel/usermodehelper/inheritable + echo "$CAPS_USERMODEHELPER_BSET" > /proc/sys/kernel/usermodehelper/bset + echo "$CAPS_USERMODEHELPER_BSET" > /proc/sys/kernel/usermodehelper/inheritable fi echo "CAPS_INIT_DROP=\"$CAPS_INIT_DROP\"" > /etc/capsdrop