Add additional gids support

Signed-off-by: Mrunal Patel <mrunalp@gmail.com>
This commit is contained in:
Mrunal Patel 2015-10-07 16:51:53 -04:00
parent f184a880a2
commit 546c5c80dc
1 changed files with 4 additions and 0 deletions

View File

@ -9,6 +9,7 @@ import (
"os" "os"
"path/filepath" "path/filepath"
"runtime" "runtime"
"strconv"
"strings" "strings"
"syscall" "syscall"
@ -406,6 +407,9 @@ func createLibcontainerConfig(cgroupName string, spec *specs.LinuxSpec, rspec *s
config.Sysctl = rspec.Linux.Sysctl config.Sysctl = rspec.Linux.Sysctl
config.ProcessLabel = rspec.Linux.SelinuxProcessLabel config.ProcessLabel = rspec.Linux.SelinuxProcessLabel
config.AppArmorProfile = rspec.Linux.ApparmorProfile config.AppArmorProfile = rspec.Linux.ApparmorProfile
for _, g := range spec.Process.User.AdditionalGids {
config.AdditionalGroups = append(config.AdditionalGroups, strconv.FormatUint(uint64(g), 10))
}
createHooks(rspec, config) createHooks(rspec, config)
config.Version = specs.Version config.Version = specs.Version
return config, nil return config, nil