Introduce interfaces.SecurityBackendOptions for passing Preseed mode flag to backends via Initialize(). Change maybeRestart to a method of snap manager.

This commit is contained in:
Pawel Stolowski
2020-02-18 10:43:41 +01:00
parent 917786e029
commit b87345b8bb
14 changed files with 56 additions and 44 deletions
+1 -6
View File
@@ -30,7 +30,6 @@ import (
"github.com/snapcore/snapd/interfaces/seccomp"
"github.com/snapcore/snapd/interfaces/systemd"
"github.com/snapcore/snapd/interfaces/udev"
"github.com/snapcore/snapd/release"
apparmor_sandbox "github.com/snapcore/snapd/sandbox/apparmor"
)
@@ -72,11 +71,7 @@ func backends() []interfaces.SecurityBackend {
// profiles that keep applications operational, in forced-devmode.
switch apparmor_sandbox.ProbedLevel() {
case apparmor_sandbox.Partial, apparmor_sandbox.Full:
aa := &apparmor.Backend{}
if release.PreseedMode() {
aa.SetPreseedMode()
}
all = append(all, aa)
all = append(all, &apparmor.Backend{})
}
return all
}