Skip to content

Commit

Permalink
daemon.start: stop disabling Apparmor restrictions on unpriv userns/u…
Browse files Browse the repository at this point in the history
…nconfined

Those restrictions are not enabled in 23.10 so LXD no longer need to
force disable them. If they are enabled, it means the user opted into
it, probably for testing the features, in which case LXD shouldn't
undo the user's decision.

Signed-off-by: Simon Deziel <[email protected]>
  • Loading branch information
simondeziel authored and tomponline committed Dec 11, 2023
1 parent 5d241a1 commit 461786a
Showing 1 changed file with 0 additions and 14 deletions.
14 changes: 0 additions & 14 deletions snapcraft/commands/daemon.start
Original file line number Diff line number Diff line change
Expand Up @@ -427,20 +427,6 @@ if [ "$(stat -c '%u' /proc)" = 0 ]; then
echo 1 > /proc/sys/kernel/unprivileged_userns_clone || true
fi
fi

if [ -e /proc/sys/kernel/apparmor_restrict_unprivileged_userns ]; then
if [ "$(cat /proc/sys/kernel/apparmor_restrict_unprivileged_userns)" = "1" ]; then
echo "==> Disabling Apparmor unprivileged userns mediation"
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
Expand Down

0 comments on commit 461786a

Please sign in to comment.