From d4f1f9310b7b2fa78af25c142523f991d0dbb4a5 Mon Sep 17 00:00:00 2001 From: Christian Boltz Date: Mon, 18 Mar 2019 17:45:53 +0000 Subject: [PATCH] Merge branch 'cboltz-subshell' into 'master' remove_profiles(): Fix returning $retval See merge request apparmor/apparmor!352 Acked-by: Eric Chiang for 2.11..master (cherry picked from commit c9148a304c1241066bf089c555db169cb8feec43) be02f008 remove_profiles(): Fix returning $retval --- parser/rc.apparmor.functions | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/parser/rc.apparmor.functions b/parser/rc.apparmor.functions index c9086a6d6..22e8367f7 100644 --- a/parser/rc.apparmor.functions +++ b/parser/rc.apparmor.functions @@ -409,14 +409,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() {