merge branch 'pr-1816'

runc: not require uid/gid mappings if euid()==0

LGTMs: @mrunalp @cyphar
Closes #1816
This commit is contained in:
Aleksa Sarai 2018-06-15 18:35:57 +10:00
commit b222ea4469
No known key found for this signature in database
GPG Key ID: 9E18AA267DDB8DB4
1 changed files with 6 additions and 7 deletions

View File

@ -43,13 +43,12 @@ func rootlessMappings(config *configs.Config) error {
if !config.Namespaces.Contains(configs.NEWUSER) {
return fmt.Errorf("rootless containers require user namespaces")
}
}
if len(config.UidMappings) == 0 {
return fmt.Errorf("rootless containers requires at least one UID mapping")
}
if len(config.GidMappings) == 0 {
return fmt.Errorf("rootless containers requires at least one GID mapping")
if len(config.UidMappings) == 0 {
return fmt.Errorf("rootless containers requires at least one UID mapping")
}
if len(config.GidMappings) == 0 {
return fmt.Errorf("rootless containers requires at least one GID mapping")
}
}
return nil