From 10ba242b89f19d88963e5d2acb8317b625051c8e Mon Sep 17 00:00:00 2001 From: intrigeri Date: Thu, 27 Dec 2018 17:46:43 +0000 Subject: [PATCH] Make control flow clearer. Let's add a safety net if we ever add another return code to skip_profile. --- parser/rc.apparmor.functions | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/parser/rc.apparmor.functions b/parser/rc.apparmor.functions index cf662078d..331161449 100644 --- a/parser/rc.apparmor.functions +++ b/parser/rc.apparmor.functions @@ -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