mirror of
https://gitlab.com/apparmor/apparmor
synced 2025-09-01 06:45:38 +00:00
remove_profiles(): Fix returning $retval
Extend the subshell so that the actual (possibly non-zero) value of $retval gets returned. Before, the changed value was lost at "done" (= leaving the subshell), and the initial $retval=0 was returned. (found with shellcheck)
This commit is contained in:
@@ -340,7 +340,8 @@ remove_profiles() {
|
||||
# We filter child profiles as removing the parent will remove
|
||||
# the children
|
||||
sed -e "s/ (\(enforce\|complain\))$//" "$SFS_MOUNTPOINT/profiles" | \
|
||||
LC_COLLATE=C sort | grep -v // | while read profile ; do
|
||||
LC_COLLATE=C sort | grep -v // | {
|
||||
while read profile ; do
|
||||
echo -n "$profile" > "$SFS_MOUNTPOINT/.remove"
|
||||
rc=$?
|
||||
if [ ${rc} -ne 0 ] ; then
|
||||
@@ -349,6 +350,7 @@ remove_profiles() {
|
||||
done
|
||||
return ${retval}
|
||||
}
|
||||
}
|
||||
|
||||
apparmor_stop() {
|
||||
aa_log_daemon_msg "Unloading AppArmor profiles "
|
||||
|
Reference in New Issue
Block a user