mirror of
https://gitlab.com/apparmor/apparmor
synced 2025-08-22 10:07:12 +00:00
profile-load: use safer "read" construct
In this case it does not matter, we're merely testing if we can actually read from that file, but let's make this robust (and shellcheck happy) for future's sake. Reference: https://www.shellcheck.net/wiki/SC2162
This commit is contained in:
parent
5a41024bbe
commit
35f23a6da1
@ -42,7 +42,7 @@ aafs=/sys/kernel/security/apparmor
|
||||
|
||||
params=$module/parameters
|
||||
[ -r $params/enabled ] || exit 0 # do not load if missing
|
||||
read enabled < $params/enabled || exit 1 # if this fails, something went wrong
|
||||
read -r enabled < $params/enabled || exit 1 # if this fails, something went wrong
|
||||
[ "$enabled" = "Y" ] || exit 0 # do not load if disabled
|
||||
|
||||
/sbin/apparmor_parser -r -W "$profile" || exit 0 # LP: #1058356
|
||||
|
Loading…
x
Reference in New Issue
Block a user