Commit 22c70f26 authored by Brad Fitzpatrick's avatar Brad Fitzpatrick

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: 's avatarIan Lance Taylor <iant@golang.org>
parent 48c6048e
......@@ -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
}
......
// 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
)
// 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
)
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment