Permalink
Browse files

Check for negative gid

Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
  • Loading branch information...
crosbymichael committed Oct 10, 2017
1 parent f55f79d commit 5f9284cb98ca12132e089ab5e051fd16b0b9df85
Showing with 5 additions and 0 deletions.
  1. +3 −0 exec.go
  2. +2 −0 tests/integration/exec.bats
View
@@ -213,6 +213,9 @@ func getProcess(context *cli.Context, bundle string) (*specs.Process, error) {
p.User.UID = uint32(uid)
}
for _, gid := range context.Int64Slice("additional-gids") {
if gid < 0 {
return nil, fmt.Errorf("additional-gids must be a positive number %d", gid)
}
p.User.AdditionalGids = append(p.User.AdditionalGids, uint32(gid))
}
return p, nil
@@ -114,6 +114,8 @@ function teardown() {
}
@test "runc exec --additional-gids" {
requires root
# run busybox detached
runc run -d --console-socket $CONSOLE_SOCKET test_busybox
[ "$status" -eq 0 ]

0 comments on commit 5f9284c

Please sign in to comment.