Fix aa-remove-unknown for 'unconfined' profiles

Without this patch, aa-remove-unknown uses 'profile_name (unconfined)'
when trying to unload unconfined profiles, which fails for obvious
reasons with (picking a random example)

    Removing 'busybox (unconfined)'
    /sbin/aa-remove-unknown: line 112: echo: write error: No such file or directory
This commit is contained in:
Christian Boltz 2024-05-25 13:12:49 +02:00
parent 38dfa14c60
commit cabd88a940
Failed to generate hash of commit

View file

@ -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}'" ) {
str = sub(/ \((enforce|complain)\)$/, "", $0); str = sub(/ \((enforce|complain|unconfined)\)$/, "", $0);
if (match($0, /^libvirt-[0-9a-f\-]+$/) == 0) if (match($0, /^libvirt-[0-9a-f\-]+$/) == 0)
arr[$str] = $str arr[$str] = $str
} }