Comment 7 for bug 1668892

Revision history for this message
Christian Boltz (cboltz) wrote : Re: apparmor package upgrades unload all LXD profiles

aa-remove-unknown:
...
+ else
+ echo "Removing '${profile}'"
+ echo -n "$profile" > "${REMOVE}"
+ fi
+ done
+
+# will not catch all errors, but still better than nothing
+exit $?

I slightly disagree with the "better than nothing" part ;-)

If I didn't miss something, the only thing that could go wrong is
+ echo -n "$profile" > "${REMOVE}"

It would be much better to use something like
+ echo -n "$profile" > "${REMOVE}" || failure=1
...
exit $failure

(obviously, also initialize failure=0 before the loop)