diff --git a/snapcraft/commands/daemon.start b/snapcraft/commands/daemon.start index 4f90f2a08..54f0ff1b6 100755 --- a/snapcraft/commands/daemon.start +++ b/snapcraft/commands/daemon.start @@ -429,6 +429,13 @@ if [ "$(stat -c '%u' /proc)" = 0 ]; then echo 0 > /proc/sys/kernel/apparmor_restrict_unprivileged_userns || true fi fi + + if [ -e /proc/sys/kernel/apparmor_restrict_unprivileged_unconfined ]; then + if [ "$(cat /proc/sys/kernel/apparmor_restrict_unprivileged_unconfined)" = "1" ]; then + echo "==> Disabling Apparmor unprivileged unconfined mediation" + echo 0 > /proc/sys/kernel/apparmor_restrict_unprivileged_unconfined || true + fi + fi fi # Setup CRIU