Fixes #17092.
Change-Id: If203d802a919e00594ddc1282782fc59a083fd63
Reviewed-on: https://go-review.googlesource.com/31458
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
// 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
}
import "unsafe"
const (
- _SYS_dup = SYS_DUP2
- _SYS_getdents = SYS_GETDENTS64
+ _SYS_dup = SYS_DUP2
+ _SYS_getdents = SYS_GETDENTS64
+ _SYS_setgroups = SYS_SETGROUPS32
)
func setTimespec(sec, nsec int64) Timespec {
package syscall
const (
- _SYS_dup = SYS_DUP2
- _SYS_getdents = SYS_GETDENTS64
+ _SYS_dup = SYS_DUP2
+ _SYS_getdents = SYS_GETDENTS64
+ _SYS_setgroups = SYS_SETGROUPS
)
//sys Dup2(oldfd int, newfd int) (err error)
import "unsafe"
const (
- _SYS_dup = SYS_DUP2
- _SYS_getdents = SYS_GETDENTS64
+ _SYS_dup = SYS_DUP2
+ _SYS_getdents = SYS_GETDENTS64
+ _SYS_setgroups = SYS_SETGROUPS32
)
func setTimespec(sec, nsec int64) Timespec {
package syscall
const (
- _SYS_dup = SYS_DUP3
- _SYS_getdents = SYS_GETDENTS64
+ _SYS_dup = SYS_DUP3
+ _SYS_getdents = SYS_GETDENTS64
+ _SYS_setgroups = SYS_SETGROUPS
)
//sys Fchown(fd int, uid int, gid int) (err error)
// to support older kernels, we have to use getdents for mips64.
// Also note that struct dirent is different for these two.
// Lookup linux_dirent{,64} in kernel source code for details.
- _SYS_getdents = SYS_GETDENTS
+ _SYS_getdents = SYS_GETDENTS
+ _SYS_setgroups = SYS_SETGROUPS
)
//sys Dup2(oldfd int, newfd int) (err error)
package syscall
const (
- _SYS_dup = SYS_DUP2
- _SYS_getdents = SYS_GETDENTS64
+ _SYS_dup = SYS_DUP2
+ _SYS_getdents = SYS_GETDENTS64
+ _SYS_setgroups = SYS_SETGROUPS
)
//sys Dup2(oldfd int, newfd int) (err error)
import "unsafe"
const (
- _SYS_dup = SYS_DUP2
- _SYS_getdents = SYS_GETDENTS64
+ _SYS_dup = SYS_DUP2
+ _SYS_getdents = SYS_GETDENTS64
+ _SYS_setgroups = SYS_SETGROUPS
)
//sys Dup2(oldfd int, newfd int) (err error)