summaryrefslogtreecommitdiff
path: root/libpod
diff options
context:
space:
mode:
authorDaniel J Walsh <dwalsh@redhat.com>2020-07-15 16:33:24 -0400
committerMatthew Heon <matthew.heon@pm.me>2020-07-22 13:14:15 -0400
commitcb603b8a3e4a4a1da194ed020caf270fa85f6f5b (patch)
tree10631dc3d3a556ad1f9d30481764f69216d9b4ce /libpod
parent2d24487ba244e5cd900f6aecc5d8896e1354d1ee (diff)
downloadpodman-cb603b8a3e4a4a1da194ed020caf270fa85f6f5b.tar.gz
podman-cb603b8a3e4a4a1da194ed020caf270fa85f6f5b.tar.bz2
podman-cb603b8a3e4a4a1da194ed020caf270fa85f6f5b.zip
Support default profile for apparmor
Currently you can not apply an ApparmorProfile if you specify --privileged. This patch will allow both to be specified simultaniosly. By default Apparmor should be disabled if the user specifies --privileged, but if the user specifies --security apparmor:PROFILE, with --privileged, we should do both. Added e2e run_apparmor_test.go Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
Diffstat (limited to 'libpod')
-rw-r--r--libpod/container_internal_linux.go2
1 files changed, 1 insertions, 1 deletions
diff --git a/libpod/container_internal_linux.go b/libpod/container_internal_linux.go
index cb70aea62..018e2d5a4 100644
--- a/libpod/container_internal_linux.go
+++ b/libpod/container_internal_linux.go
@@ -244,7 +244,7 @@ func (c *Container) generateSpec(ctx context.Context) (*spec.Spec, error) {
}
// Apply AppArmor checks and load the default profile if needed.
- if !c.config.Privileged {
+ if len(c.config.Spec.Process.ApparmorProfile) > 0 {
updatedProfile, err := apparmor.CheckProfileAndLoadDefault(c.config.Spec.Process.ApparmorProfile)
if err != nil {
return nil, err