summaryrefslogtreecommitdiff
path: root/libpod
diff options
context:
space:
mode:
Diffstat (limited to 'libpod')
-rw-r--r--libpod/container_api.go4
-rw-r--r--libpod/runtime_volume_linux.go2
-rw-r--r--libpod/util_linux.go13
3 files changed, 10 insertions, 9 deletions
diff --git a/libpod/container_api.go b/libpod/container_api.go
index d74a14f15..d612341bc 100644
--- a/libpod/container_api.go
+++ b/libpod/container_api.go
@@ -11,8 +11,8 @@ import (
"github.com/containers/libpod/libpod/define"
"github.com/containers/libpod/libpod/events"
+ "github.com/containers/libpod/pkg/capabilities"
"github.com/containers/storage/pkg/stringid"
- "github.com/docker/docker/oci/caps"
"github.com/opentracing/opentracing-go"
"github.com/pkg/errors"
"github.com/sirupsen/logrus"
@@ -237,7 +237,7 @@ func (c *Container) Exec(tty, privileged bool, env map[string]string, cmd []stri
}
if privileged || c.config.Privileged {
- capList = caps.GetAllCapabilities()
+ capList = capabilities.AllCapabilities()
}
// Generate exec session ID
diff --git a/libpod/runtime_volume_linux.go b/libpod/runtime_volume_linux.go
index e1f3480ce..037cf4cc2 100644
--- a/libpod/runtime_volume_linux.go
+++ b/libpod/runtime_volume_linux.go
@@ -85,7 +85,7 @@ func (r *Runtime) newVolume(ctx context.Context, options ...VolumeCreateOption)
if err := os.Chown(fullVolPath, volume.config.UID, volume.config.GID); err != nil {
return nil, errors.Wrapf(err, "error chowning volume directory %q to %d:%d", fullVolPath, volume.config.UID, volume.config.GID)
}
- if err := LabelVolumePath(fullVolPath, true); err != nil {
+ if err := LabelVolumePath(fullVolPath); err != nil {
return nil, err
}
volume.config.MountPoint = fullVolPath
diff --git a/libpod/util_linux.go b/libpod/util_linux.go
index 631f6836c..f0b4028de 100644
--- a/libpod/util_linux.go
+++ b/libpod/util_linux.go
@@ -92,7 +92,7 @@ func assembleSystemdCgroupName(baseSlice, newSlice string) (string, error) {
// LabelVolumePath takes a mount path for a volume and gives it an
// selinux label of either shared or not
-func LabelVolumePath(path string, shared bool) error {
+func LabelVolumePath(path string) error {
_, mountLabel, err := label.InitLabels([]string{})
if err != nil {
return errors.Wrapf(err, "error getting default mountlabels")
@@ -100,12 +100,13 @@ func LabelVolumePath(path string, shared bool) error {
if err := label.ReleaseLabel(mountLabel); err != nil {
return errors.Wrapf(err, "error releasing label %q", mountLabel)
}
- if err := label.Relabel(path, mountLabel, shared); err != nil {
- permString := "private"
- if shared {
- permString = "shared"
+
+ if err := label.Relabel(path, mountLabel, true); err != nil {
+ if err != syscall.ENOTSUP {
+ logrus.Debugf("Labeling not supported on %q", path)
+ } else {
+ return errors.Wrapf(err, "error setting selinux label for %s to %q as shared", path, mountLabel)
}
- return errors.Wrapf(err, "error setting selinux label for %s to %q as %s", path, mountLabel, permString)
}
return nil
}