Last active
October 25, 2022 23:42
-
-
Save cerebrate/1c9cc1d1b9dfb883e5c46307766cc037 to your computer and use it in GitHub Desktop.
Better patch for apparmor under WSL
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- rc.apparmor.functions 2021-11-08 13:27:06.461249682 -0600 | |
+++ rc.apparmor.functions 2021-11-08 13:30:05.766141212 -0600 | |
@@ -68,7 +68,7 @@ | |
# something like `systemd-detect-virt --container`. | |
# | |
# The only known container environments capable of supporting internal policy | |
-# are LXD and LXC environment. | |
+# are LXD and LXC environments and Windows Subsystem for Linux. | |
# | |
# Returns 0 if the container environment is capable of having its own internal | |
# policy and non-zero otherwise. | |
@@ -91,6 +91,11 @@ | |
local ns_stacked | |
local ns_name | |
+ # WSL needs to be detected explicitly | |
+ if [ $(systemd-detect-virt --container) = "wsl" ]; then | |
+ return 0 | |
+ fi | |
+ | |
if ! [ -f "$ns_stacked_path" ] || ! [ -f "$ns_name_path" ]; then | |
return 1 | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment