mirror of
https://github.com/lm-sensors/lm-sensors.git
synced 2026-11-08 16:11:26 +00:00
fancontrol: Do command substitution in double quotes
Do command substitution in double quotes to prevent word splitting. The issue was reported by Coverity Scan. Signed-off-by: Ondřej Lysoněk <olysonek@redhat.com>
This commit is contained in:
1 parent
40aa494c02
commit
fb595f55d1
1 file changed
+5
-5
+5
-5
@@ -421,12 +421,12 @@ function pwmdisable()
|
|||||||
# check if setting pwmN_enable value was successful. Checking the
|
# check if setting pwmN_enable value was successful. Checking the
|
||||||
# pwmN value makes no sense, as it might already have been altered
|
# pwmN value makes no sense, as it might already have been altered
|
||||||
# by the chip.
|
# by the chip.
|
||||||
if [ $(cat $ENABLE) = ${PWM_ENABLE_ORIG_STATE[${1}]} ]
|
if [ "$(cat $ENABLE)" = ${PWM_ENABLE_ORIG_STATE[${1}]} ]
|
||||||
then
|
then
|
||||||
return 0
|
return 0
|
||||||
fi
|
fi
|
||||||
# if pwmN_enable is manual (1), check if restoring the pwmN value worked
|
# if pwmN_enable is manual (1), check if restoring the pwmN value worked
|
||||||
elif [ $(cat ${1}) = ${PWM_ORIG_STATE[${1}]} ]
|
elif [ "$(cat ${1})" = ${PWM_ORIG_STATE[${1}]} ]
|
||||||
then
|
then
|
||||||
return 0
|
return 0
|
||||||
fi
|
fi
|
||||||
@@ -434,7 +434,7 @@ function pwmdisable()
|
|||||||
|
|
||||||
# Try pwmN_enable=0
|
# Try pwmN_enable=0
|
||||||
echo 0 > $ENABLE 2> /dev/null
|
echo 0 > $ENABLE 2> /dev/null
|
||||||
if [ $(cat $ENABLE) -eq 0 ]
|
if [ "$(cat $ENABLE)" -eq 0 ]
|
||||||
then
|
then
|
||||||
# Success
|
# Success
|
||||||
return 0
|
return 0
|
||||||
@@ -443,14 +443,14 @@ function pwmdisable()
|
|||||||
# It didn't work, try pwmN_enable=1 pwmN=255
|
# It didn't work, try pwmN_enable=1 pwmN=255
|
||||||
echo 1 > $ENABLE 2> /dev/null
|
echo 1 > $ENABLE 2> /dev/null
|
||||||
echo $MAX > $1
|
echo $MAX > $1
|
||||||
if [ $(cat $ENABLE) -eq 1 -a $(cat $1) -ge 190 ]
|
if [ "$(cat $ENABLE)" -eq 1 -a "$(cat $1)" -ge 190 ]
|
||||||
then
|
then
|
||||||
# Success
|
# Success
|
||||||
return 0
|
return 0
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Nothing worked
|
# Nothing worked
|
||||||
echo "$ENABLE stuck to" $(cat $ENABLE) >&2
|
echo "$ENABLE stuck to" "$(cat $ENABLE)" >&2
|
||||||
return 1
|
return 1
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in new issue
Block a user