Simplify profiles_names_list()

... which is used by aa-remove-unknown.

apparmor_parser can read a whole directory, therefore we don't need to
do the directory listing, excluding *.rpmnew etc. ourself.

Related to https://gitlab.com/apparmor/apparmor/-/issues/148
This commit is contained in:
Christian Boltz 2022-02-10 22:53:48 +01:00
parent 9aa1a5b492
commit d38376c9c4
Failed to generate hash of commit

View file

@ -215,14 +215,10 @@ profiles_names_list() {
continue
fi
for profile in "$profile_dir"/*; do
if skip_profile "$profile" && [ -f "$profile" ] ; then
LIST_ADD=$("$PARSER" -N "$profile" )
if [ $? -eq 0 ]; then
echo "$LIST_ADD"
fi
fi
done
LIST_ADD=$("$PARSER" -N "$profile_dir" )
if [ $? -eq 0 ]; then
echo "$LIST_ADD"
fi
done
}