aboutsummaryrefslogtreecommitdiff
path: root/pkg/util/mountOpts.go
diff options
context:
space:
mode:
authorMatthew Heon <matthew.heon@pm.me>2019-08-23 15:10:57 -0400
committerMatthew Heon <matthew.heon@pm.me>2019-08-28 14:28:18 -0400
commit820e242e821efda218031b75fce01625a20baa54 (patch)
tree0eb6696eb199491ea00a66eeebeaf0fc5dcf5578 /pkg/util/mountOpts.go
parent5bdd97f77fc3100c6338928d4d54af32273d36fb (diff)
downloadpodman-820e242e821efda218031b75fce01625a20baa54.tar.gz
podman-820e242e821efda218031b75fce01625a20baa54.tar.bz2
podman-820e242e821efda218031b75fce01625a20baa54.zip
Allow :z and :Z with ProcessOptions
Signed-off-by: Matthew Heon <matthew.heon@pm.me>
Diffstat (limited to 'pkg/util/mountOpts.go')
-rw-r--r--pkg/util/mountOpts.go9
1 files changed, 8 insertions, 1 deletions
diff --git a/pkg/util/mountOpts.go b/pkg/util/mountOpts.go
index 8accd4697..9e387ce95 100644
--- a/pkg/util/mountOpts.go
+++ b/pkg/util/mountOpts.go
@@ -27,7 +27,7 @@ type DefaultMountOptions struct {
// is not included, they will be set unconditionally.
func ProcessOptions(options []string, isTmpfs bool, defaults *DefaultMountOptions) ([]string, error) {
var (
- foundWrite, foundSize, foundProp, foundMode, foundExec, foundSuid, foundDev, foundCopyUp, foundBind bool
+ foundWrite, foundSize, foundProp, foundMode, foundExec, foundSuid, foundDev, foundCopyUp, foundBind, foundZ bool
)
for _, opt := range options {
@@ -91,6 +91,13 @@ func ProcessOptions(options []string, isTmpfs bool, defaults *DefaultMountOption
return nil, errors.Wrapf(ErrDupeMntOption, "only one of 'rbind' and 'bind' can be used")
}
foundBind = true
+ case "z", "Z":
+ if isTmpfs {
+ return nil, errors.Wrapf(ErrBadMntOption, "the 'z' and 'Z' options are not allowed with tmpfs mounts")
+ }
+ if foundZ {
+ return nil, errors.Wrapf(ErrDupeMntOption, "only one of 'z' and 'Z' can be used")
+ }
default:
return nil, errors.Wrapf(ErrBadMntOption, "unknown mount option %q", opt)
}