mirror of
https://github.com/golang/go.git
synced 2025-12-08 06:10:04 +00:00
syscall: for ForkExec on Linux, always use 32-bit setgroups system call
Fixes #17092. Change-Id: If203d802a919e00594ddc1282782fc59a083fd63 Reviewed-on: https://go-review.googlesource.com/31458 Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
This commit is contained in:
parent
f2f8d58b92
commit
6c295a9a71
8 changed files with 21 additions and 14 deletions
|
|
@ -214,7 +214,7 @@ func forkAndExecInChild(argv0 *byte, argv, envv []*byte, chroot, dir *byte, attr
|
|||
// and disabled setgroups, because otherwise unprivileged user namespace
|
||||
// will fail with any non-empty SysProcAttr.Credential.
|
||||
if !(sys.GidMappings != nil && !sys.GidMappingsEnableSetgroups && ngroups == 0) {
|
||||
_, _, err1 = RawSyscall(SYS_SETGROUPS, ngroups, groups, 0)
|
||||
_, _, err1 = RawSyscall(_SYS_setgroups, ngroups, groups, 0)
|
||||
if err1 != 0 {
|
||||
goto childerror
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue