From 9ec5134322af716b10639b0a38df5e5644f9ec0f Mon Sep 17 00:00:00 2001 From: Georgia Garcia Date: Tue, 28 May 2024 19:17:53 +0000 Subject: [PATCH] Merge 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 I propose this patch for 4.0 and master. MR: https://gitlab.com/apparmor/apparmor/-/merge_requests/1240 Approved-by: Georgia Garcia Merged-by: Georgia Garcia (cherry picked from commit cf5be7d3563b3bea4c34ce6fcefc83491b4836e0) cabd88a9 Fix aa-remove-unknown for 'unconfined' profiles Co-authored-by: Georgia Garcia --- utils/aa-remove-unknown | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/utils/aa-remove-unknown b/utils/aa-remove-unknown index 0e00d6a03..983d23727 100755 --- a/utils/aa-remove-unknown +++ b/utils/aa-remove-unknown @@ -89,7 +89,7 @@ LOADED_PROFILES=$("$PARSER" -N $PROFILE_DIRS) || { echo "$LOADED_PROFILES" | awk ' BEGIN { while (getline < "'${PROFILES}'" ) { - str = sub(/ \((enforce|complain)\)$/, "", $0); + str = sub(/ \((enforce|complain|unconfined)\)$/, "", $0); if (match($0, /^libvirt-[0-9a-f\-]+$/) == 0) arr[$str] = $str }