aboutsummaryrefslogtreecommitdiff
path: root/vendor/github.com/opencontainers/selinux/go-selinux/label/label_linux.go
diff options
context:
space:
mode:
authorOpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com>2021-05-12 20:53:08 -0400
committerGitHub <noreply@github.com>2021-05-12 20:53:08 -0400
commit4dc52f61cc5222fe59140f6e6864b78dec8f64f2 (patch)
tree2add1514b4aaf87f73d3bbc290c664ed9d559a55 /vendor/github.com/opencontainers/selinux/go-selinux/label/label_linux.go
parent0762970096e0d9f81f88e56b696f1002bf3fe30e (diff)
parenteccd03f3c40ad98b87138e6d67f18785f53da788 (diff)
downloadpodman-4dc52f61cc5222fe59140f6e6864b78dec8f64f2.tar.gz
podman-4dc52f61cc5222fe59140f6e6864b78dec8f64f2.tar.bz2
podman-4dc52f61cc5222fe59140f6e6864b78dec8f64f2.zip
Merge pull request #10316 from containers/dependabot/go_modules/github.com/containers/storage-1.30.3
Bump github.com/containers/storage from 1.30.2 to 1.30.3
Diffstat (limited to 'vendor/github.com/opencontainers/selinux/go-selinux/label/label_linux.go')
-rw-r--r--vendor/github.com/opencontainers/selinux/go-selinux/label/label_linux.go5
1 files changed, 4 insertions, 1 deletions
diff --git a/vendor/github.com/opencontainers/selinux/go-selinux/label/label_linux.go b/vendor/github.com/opencontainers/selinux/go-selinux/label/label_linux.go
index 439455511..b3d142d8c 100644
--- a/vendor/github.com/opencontainers/selinux/go-selinux/label/label_linux.go
+++ b/vendor/github.com/opencontainers/selinux/go-selinux/label/label_linux.go
@@ -25,6 +25,8 @@ var ErrIncompatibleLabel = errors.New("Bad SELinux option z and Z can not be use
// the container. A list of options can be passed into this function to alter
// the labels. The labels returned will include a random MCS String, that is
// guaranteed to be unique.
+// If the disabled flag is passed in, the process label will not be set, but the mount label will be set
+// to the container_file label with the maximum category. This label is not usable by any confined label.
func InitLabels(options []string) (plabel string, mlabel string, retErr error) {
if !selinux.GetEnabled() {
return "", "", nil
@@ -47,7 +49,8 @@ func InitLabels(options []string) (plabel string, mlabel string, retErr error) {
}
for _, opt := range options {
if opt == "disable" {
- return "", mountLabel, nil
+ selinux.ReleaseLabel(mountLabel)
+ return "", selinux.PrivContainerMountLabel(), nil
}
if i := strings.Index(opt, ":"); i == -1 {
return "", "", errors.Errorf("Bad label option %q, valid options 'disable' or \n'user, role, level, type, filetype' followed by ':' and a value", opt)