From e17a59ae5b8e98136ba0f3f1f2c9ae08e5f038ed Mon Sep 17 00:00:00 2001 From: Simon Deziel Date: Tue, 3 Oct 2023 08:41:07 -0400 Subject: [PATCH] wrappers/editor: workaround Apparmor unpriv userns mediation Signed-off-by: Simon Deziel --- snapcraft/wrappers/editor | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/snapcraft/wrappers/editor b/snapcraft/wrappers/editor index fde501685..3611cb88d 100755 --- a/snapcraft/wrappers/editor +++ b/snapcraft/wrappers/editor @@ -16,7 +16,8 @@ run_cmd() { } USERNS=1 -[ -e /proc/sys/kernel/unprivileged_userns_clone ] && grep -q 0 /proc/sys/kernel/unprivileged_userns_clone && USERNS=0 +[ -e /proc/sys/kernel/unprivileged_userns_clone ] && grep -qxF 0 /proc/sys/kernel/unprivileged_userns_clone && USERNS=0 +[ -e /proc/sys/kernel/apparmor_restrict_unprivileged_userns ] && grep -qxF 1 /proc/sys/kernel/apparmor_restrict_unprivileged_userns && USERNS=0 find_and_spawn() { for path in / /usr/ /usr/local/; do