mirror of
https://gitlab.com/apparmor/apparmor
synced 2025-08-31 06:16:03 +00:00
- fix rcapparmor stop. Have it dump the loaded profile list to a file before
removing profiles, as the list is unstable after additions or removals. - Add the ability to loaded precompiled policy by specifying the -B option, which can be combined with --add or --replace
This commit is contained in:
@@ -373,13 +373,18 @@ remove_profiles() {
|
||||
fi
|
||||
|
||||
retval=0
|
||||
sed -e "s/ (\(enforce\|complain\))$//" "$SFS_MOUNTPOINT/profiles" | while read profile ; do
|
||||
#the list of profiles isn't stable once we start adding or removing
|
||||
#them so stor to tmp first
|
||||
MODULE_PLIST=$(mktemp ${APPARMOR_TMPDIR}/tmp.XXXXXXXX)
|
||||
sed -e "s/ (\(enforce\|complain\))$//" "$SFS_MOUNTPOINT/profiles" | sort >"$MODULE_PLIST"
|
||||
cat "$MODULE_PLIST" | while read profile ; do
|
||||
echo -n "$profile" > "$SFS_MOUNTPOINT/.remove"
|
||||
rc=$?
|
||||
if [ ${rc} -ne 0 ] ; then
|
||||
retval=${rc}
|
||||
fi
|
||||
done
|
||||
rm "$MODULE_PLIST"
|
||||
if [ ${retval} -eq 0 ] ; then
|
||||
aa_log_success_msg
|
||||
else
|
||||
|
Reference in New Issue
Block a user