aboutsummaryrefslogtreecommitdiff
path: root/libpod/options.go
diff options
context:
space:
mode:
authorDaniel J Walsh <dwalsh@redhat.com>2018-09-18 09:06:40 -0400
committerAtomic Bot <atomic-devel@projectatomic.io>2018-09-20 16:01:29 +0000
commitfbfcc7842e0e3361c53bc607411c200824c111b4 (patch)
tree206996ea536a26ed17a8f79326a1e51041c4147f /libpod/options.go
parent2cbb8c216a2f8e7160cdf88ef6ef50ee75559d96 (diff)
downloadpodman-fbfcc7842e0e3361c53bc607411c200824c111b4.tar.gz
podman-fbfcc7842e0e3361c53bc607411c200824c111b4.tar.bz2
podman-fbfcc7842e0e3361c53bc607411c200824c111b4.zip
Add new field to libpod to indicate whether or not to use labelling
Also update some missing fields libpod.conf obtions in man pages. Fix sort order of security options and add a note about disabling labeling. When a process requests a new label. libpod needs to reserve all labels to make sure that their are no conflicts. Signed-off-by: Daniel J Walsh <dwalsh@redhat.com> Closes: #1406 Approved by: mheon
Diffstat (limited to 'libpod/options.go')
-rw-r--r--libpod/options.go12
1 files changed, 7 insertions, 5 deletions
diff --git a/libpod/options.go b/libpod/options.go
index 1a29c0705..977f3f4c2 100644
--- a/libpod/options.go
+++ b/libpod/options.go
@@ -373,15 +373,17 @@ func WithPrivileged(privileged bool) CtrCreateOption {
}
}
-// WithSELinuxLabels sets the mount label for SELinux.
-func WithSELinuxLabels(processLabel, mountLabel string) CtrCreateOption {
+// WithSecLabels sets the labels for SELinux.
+func WithSecLabels(labelOpts []string) CtrCreateOption {
return func(ctr *Container) error {
if ctr.valid {
return ErrCtrFinalized
}
-
- ctr.config.ProcessLabel = processLabel
- ctr.config.MountLabel = mountLabel
+ var err error
+ ctr.config.ProcessLabel, ctr.config.MountLabel, err = ctr.runtime.initLabels(labelOpts)
+ if err != nil {
+ return errors.Wrapf(err, "failed to init labels")
+ }
return nil
}
}