diff --git a/parser/rc.apparmor.functions b/parser/rc.apparmor.functions index 4e1ce9c82d12f8c9ff66eb5c0a0c25bf97b873f2..d1d5a4c3f4480f74809a5730122885e6abffee31 100644 --- a/parser/rc.apparmor.functions +++ b/parser/rc.apparmor.functions @@ -340,14 +340,16 @@ 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 - echo -n "$profile" > "$SFS_MOUNTPOINT/.remove" - rc=$? - if [ ${rc} -ne 0 ] ; then - retval=${rc} - fi - done - return ${retval} + LC_COLLATE=C sort | grep -v // | { + while read profile ; do + echo -n "$profile" > "$SFS_MOUNTPOINT/.remove" + rc=$? + if [ ${rc} -ne 0 ] ; then + retval=${rc} + fi + done + return ${retval} + } } apparmor_stop() {