summaryrefslogtreecommitdiff
path: root/pkg/util
diff options
context:
space:
mode:
authorDaniel J Walsh <dwalsh@redhat.com>2022-02-08 17:07:29 -0500
committerDaniel J Walsh <dwalsh@redhat.com>2022-02-08 17:08:49 -0500
commit61f97083c63bfc0636235c4bd9e4aa586478bf20 (patch)
tree0eabb95ff5dd62407ab36a4220b428aace77c89c /pkg/util
parent6ffd59828dd3c58c0927bd715e0a5a7b0c3baf2f (diff)
downloadpodman-61f97083c63bfc0636235c4bd9e4aa586478bf20.tar.gz
podman-61f97083c63bfc0636235c4bd9e4aa586478bf20.tar.bz2
podman-61f97083c63bfc0636235c4bd9e4aa586478bf20.zip
idmap should be able to be specified along with other options
[NO NEW TESTS NEEDED] crun is not available everywhere to test idmap. Kernel might not be recent enough and not all file systems support idmap option. Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
Diffstat (limited to 'pkg/util')
-rw-r--r--pkg/util/mountOpts.go7
1 files changed, 4 insertions, 3 deletions
diff --git a/pkg/util/mountOpts.go b/pkg/util/mountOpts.go
index f32cf6ea6..d8b14c0df 100644
--- a/pkg/util/mountOpts.go
+++ b/pkg/util/mountOpts.go
@@ -25,7 +25,7 @@ type defaultMountOptions struct {
// The sourcePath variable, if not empty, contains a bind mount source.
func ProcessOptions(options []string, isTmpfs bool, sourcePath string) ([]string, error) {
var (
- foundWrite, foundSize, foundProp, foundMode, foundExec, foundSuid, foundDev, foundCopyUp, foundBind, foundZ, foundU, foundOverlay bool
+ foundWrite, foundSize, foundProp, foundMode, foundExec, foundSuid, foundDev, foundCopyUp, foundBind, foundZ, foundU, foundOverlay, foundIdmap bool
)
newOptions := make([]string, 0, len(options))
@@ -49,9 +49,10 @@ func ProcessOptions(options []string, isTmpfs bool, sourcePath string) ([]string
case "O":
foundOverlay = true
case "idmap":
- if len(options) > 1 {
- return nil, errors.Wrapf(ErrDupeMntOption, "'O' option can not be used with other options")
+ if foundIdmap {
+ return nil, errors.Wrapf(ErrDupeMntOption, "the 'idmap' option can only be set once")
}
+ foundIdmap = true
case "exec", "noexec":
if foundExec {
return nil, errors.Wrapf(ErrDupeMntOption, "only one of 'noexec' and 'exec' can be used")