2
0
mirror of https://gitlab.com/apparmor/apparmor synced 2025-08-31 06:16:03 +00:00

Make control flow clearer.

Let's add a safety net if we ever add another return code to skip_profile.
This commit is contained in:
intrigeri
2018-12-27 17:46:43 +00:00
parent 5865d01449
commit 10ba242b89

View File

@@ -189,14 +189,14 @@ __parse_profiles_dir() {
for profile in $profile_dir/*; do
skip_profile "${profile}"
skip=$?
# Ignore skip status == 2 (silent skip)
if [ "$skip" -eq 1 ] ; then
if [ "$skip" -eq 2 ]; then
# Ignore skip status == 2 (silent skip)
continue
elif [ "$skip" -ne 0 ] ; then
aa_log_skipped_msg "$profile"
logger -t "AppArmor(init)" -p daemon.warn \
"Skipping profile $profile"
continue
elif [ "$skip" -ne 0 ]; then
continue
fi
if [ ! -f "${profile}" ] ; then
continue