diff options
author | Matthew Heon <matthew.heon@pm.me> | 2019-08-23 15:10:57 -0400 |
---|---|---|
committer | Matthew Heon <matthew.heon@pm.me> | 2019-08-28 14:28:18 -0400 |
commit | 820e242e821efda218031b75fce01625a20baa54 (patch) | |
tree | 0eb6696eb199491ea00a66eeebeaf0fc5dcf5578 /pkg | |
parent | 5bdd97f77fc3100c6338928d4d54af32273d36fb (diff) | |
download | podman-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')
-rw-r--r-- | pkg/util/mountOpts.go | 9 |
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) } |