diff options
author | OpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com> | 2019-08-19 13:48:15 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-08-19 13:48:15 +0200 |
commit | befaa95d93481eef0d75d3babce7c6c643ecf85f (patch) | |
tree | 9a5e0b4d46846dc885a3ea3f27ccd2b3c9affd1e /vendor/github.com/opencontainers/selinux/go-selinux/label/label_selinux.go | |
parent | 98dee275d04dafa087db12bc3f0593a078039cfb (diff) | |
parent | 316e51f0a91d24f75a9191e2226928bc0c1c5b91 (diff) | |
download | podman-befaa95d93481eef0d75d3babce7c6c643ecf85f.tar.gz podman-befaa95d93481eef0d75d3babce7c6c643ecf85f.tar.bz2 podman-befaa95d93481eef0d75d3babce7c6c643ecf85f.zip |
Merge pull request #3777 from rhatdan/vendor
Add support & documentation to run containers with different file types
Diffstat (limited to 'vendor/github.com/opencontainers/selinux/go-selinux/label/label_selinux.go')
-rw-r--r-- | vendor/github.com/opencontainers/selinux/go-selinux/label/label_selinux.go | 18 |
1 files changed, 11 insertions, 7 deletions
diff --git a/vendor/github.com/opencontainers/selinux/go-selinux/label/label_selinux.go b/vendor/github.com/opencontainers/selinux/go-selinux/label/label_selinux.go index 1eb9a6bf2..2730fcf4a 100644 --- a/vendor/github.com/opencontainers/selinux/go-selinux/label/label_selinux.go +++ b/vendor/github.com/opencontainers/selinux/go-selinux/label/label_selinux.go @@ -13,11 +13,12 @@ import ( // Valid Label Options var validOptions = map[string]bool{ - "disable": true, - "type": true, - "user": true, - "role": true, - "level": true, + "disable": true, + "type": true, + "filetype": true, + "user": true, + "role": true, + "level": true, } var ErrIncompatibleLabel = fmt.Errorf("Bad SELinux option z and Z can not be used together") @@ -51,13 +52,16 @@ func InitLabels(options []string) (plabel string, mlabel string, Err error) { return "", mountLabel, nil } if i := strings.Index(opt, ":"); i == -1 { - return "", "", fmt.Errorf("Bad label option %q, valid options 'disable' or \n'user, role, level, type' followed by ':' and a value", opt) + return "", "", fmt.Errorf("Bad label option %q, valid options 'disable' or \n'user, role, level, type, filetype' followed by ':' and a value", opt) } con := strings.SplitN(opt, ":", 2) if !validOptions[con[0]] { - return "", "", fmt.Errorf("Bad label option %q, valid options 'disable, user, role, level, type'", con[0]) + return "", "", fmt.Errorf("Bad label option %q, valid options 'disable, user, role, level, type, filetype'", con[0]) } + if con[0] == "filetype" { + mcon["type"] = con[1] + } pcon[con[0]] = con[1] if con[0] == "level" || con[0] == "user" { mcon[con[0]] = con[1] |