mirror of
https://gitlab.com/apparmor/apparmor
synced 2025-08-22 18:17:09 +00:00
Support unloading profiles in kill and prompt mode
... in aa-teardown (actually everything that uses rc.apparmor.functions) and aa-remove-unknown. Fixes: https://bugs.launchpad.net/ubuntu/+source/apparmor/+bug/2093797
This commit is contained in:
parent
b4cb33b488
commit
1c2d79de7f
@ -253,7 +253,7 @@ remove_profiles() {
|
|||||||
retval=0
|
retval=0
|
||||||
# We filter child profiles as removing the parent will remove
|
# We filter child profiles as removing the parent will remove
|
||||||
# the children
|
# the children
|
||||||
sed -e "s/ (\(enforce\|complain\|unconfined\))$//" "$SFS_MOUNTPOINT/profiles" | \
|
sed -e "s/ (\(enforce\|complain\|prompt\|kill\|unconfined\))$//" "$SFS_MOUNTPOINT/profiles" | \
|
||||||
LC_COLLATE=C sort | grep -v // | {
|
LC_COLLATE=C sort | grep -v // | {
|
||||||
while read -r profile ; do
|
while read -r profile ; do
|
||||||
printf "%s" "$profile" > "$SFS_MOUNTPOINT/.remove"
|
printf "%s" "$profile" > "$SFS_MOUNTPOINT/.remove"
|
||||||
|
@ -89,7 +89,7 @@ LOADED_PROFILES=$("$PARSER" -N $PROFILE_DIRS) || {
|
|||||||
echo "$LOADED_PROFILES" | awk '
|
echo "$LOADED_PROFILES" | awk '
|
||||||
BEGIN {
|
BEGIN {
|
||||||
while (getline < "'${PROFILES}'" ) {
|
while (getline < "'${PROFILES}'" ) {
|
||||||
sub(/ \((enforce|complain|unconfined)\)$/, "", $0);
|
sub(/ \((enforce|complain|prompt|kill|unconfined)\)$/, "", $0);
|
||||||
if (match($0, /^libvirt-[0-9a-f\-]+$/) == 0)
|
if (match($0, /^libvirt-[0-9a-f\-]+$/) == 0)
|
||||||
arr[$0] = $0
|
arr[$0] = $0
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user