Merge pull request #9461 from kinvolk/rata/idmap

pkg/process: Check using idmap mount options too
This commit is contained in:
Fu Wei 2023-12-05 15:43:14 +00:00 committed by GitHub
commit 9a7130d132
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -206,6 +206,10 @@ func (p *Init) validateIDMapMounts(ctx context.Context, spec *specs.Spec) error
used = true used = true
break break
} }
if sliceContainsStr(m.Options, "idmap") || sliceContainsStr(m.Options, "ridmap") {
used = true
break
}
} }
if !used { if !used {
@ -552,3 +556,12 @@ func withConditionalIO(c stdio.Stdio) runc.IOOpt {
o.OpenStderr = c.Stderr != "" o.OpenStderr = c.Stderr != ""
} }
} }
func sliceContainsStr(s []string, str string) bool {
for _, s := range s {
if s == str {
return true
}
}
return false
}