1
0
mirror of https://github.com/golang/go synced 2024-11-23 16:50:06 -07:00

syscall: use 32-bit setuid/setgid syscalls on linux/{386,arm}

Fixes #17092

Change-Id: Ib14e4db13116ebbe4d72c414fb979d27a06d6174
Reviewed-on: https://go-review.googlesource.com/33011
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
This commit is contained in:
Brad Fitzpatrick 2016-11-09 20:35:46 +00:00
parent 48c6048e55
commit 22c70f268b
3 changed files with 28 additions and 2 deletions

View File

@ -219,11 +219,11 @@ func forkAndExecInChild(argv0 *byte, argv, envv []*byte, chroot, dir *byte, attr
goto childerror
}
}
_, _, err1 = RawSyscall(SYS_SETGID, uintptr(cred.Gid), 0, 0)
_, _, err1 = RawSyscall(sys_SETGID, uintptr(cred.Gid), 0, 0)
if err1 != 0 {
goto childerror
}
_, _, err1 = RawSyscall(SYS_SETUID, uintptr(cred.Uid), 0, 0)
_, _, err1 = RawSyscall(sys_SETUID, uintptr(cred.Uid), 0, 0)
if err1 != 0 {
goto childerror
}

View File

@ -0,0 +1,13 @@
// Copyright 2016 The Go Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
// +build linux
// +build 386 arm
package syscall
const (
sys_SETGID = SYS_SETGID32
sys_SETUID = SYS_SETUID32
)

View File

@ -0,0 +1,13 @@
// Copyright 2016 The Go Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
// +build linux
// +build !386,!arm
package syscall
const (
sys_SETGID = SYS_SETGID
sys_SETUID = SYS_SETUID
)