mirror of
https://github.com/golang/go
synced 2024-11-23 20:10:08 -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:
parent
48c6048e55
commit
22c70f268b
@ -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
|
||||
}
|
||||
|
13
src/syscall/setuidgid_32_linux.go
Normal file
13
src/syscall/setuidgid_32_linux.go
Normal 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
|
||||
)
|
13
src/syscall/setuidgid_linux.go
Normal file
13
src/syscall/setuidgid_linux.go
Normal 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
|
||||
)
|
Loading…
Reference in New Issue
Block a user