2
0
mirror of https://gitlab.com/apparmor/apparmor synced 2025-09-02 15:25:27 +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 for profile in $profile_dir/*; do
skip_profile "${profile}" skip_profile "${profile}"
skip=$? skip=$?
if [ "$skip" -eq 2 ]; then
# Ignore skip status == 2 (silent skip) # Ignore skip status == 2 (silent skip)
if [ "$skip" -eq 1 ] ; then continue
elif [ "$skip" -ne 0 ] ; then
aa_log_skipped_msg "$profile" aa_log_skipped_msg "$profile"
logger -t "AppArmor(init)" -p daemon.warn \ logger -t "AppArmor(init)" -p daemon.warn \
"Skipping profile $profile" "Skipping profile $profile"
continue continue
elif [ "$skip" -ne 0 ]; then
continue
fi fi
if [ ! -f "${profile}" ] ; then if [ ! -f "${profile}" ] ; then
continue continue