mirror of
https://github.com/golang/go.git
synced 2025-12-08 06:10:04 +00:00
syscall: disable Setuid/Setgid on linux
Update #1435 This proposal disables Setuid and Setgid on all linux platforms. Issue 1435 has been open for a long time, and it is unlikely to be addressed soon so an argument was made by a commenter https://code.google.com/p/go/issues/detail?id=1435#c45 That these functions should made to fail rather than succeed in their broken state. LGTM=ruiu, iant R=iant, ruiu CC=golang-codereviews https://golang.org/cl/106170043
This commit is contained in:
parent
7d8da7dc4d
commit
343b4ba8c1
7 changed files with 14 additions and 64 deletions
|
|
@ -1005,16 +1005,6 @@ func Settimeofday(tv *Timeval) (err error) {
|
|||
|
||||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
||||
|
||||
func Setuid(uid int) (err error) {
|
||||
_, _, e1 := RawSyscall(SYS_SETUID, uintptr(uid), 0, 0)
|
||||
if e1 != 0 {
|
||||
err = e1
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
||||
|
||||
func Setpriority(which int, who int, prio int) (err error) {
|
||||
_, _, e1 := Syscall(SYS_SETPRIORITY, uintptr(which), uintptr(who), uintptr(prio))
|
||||
if e1 != 0 {
|
||||
|
|
@ -1689,16 +1679,6 @@ func Setfsuid(uid int) (err error) {
|
|||
|
||||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
||||
|
||||
func Setgid(gid int) (err error) {
|
||||
_, _, e1 := RawSyscall(SYS_SETGID32, uintptr(gid), 0, 0)
|
||||
if e1 != 0 {
|
||||
err = e1
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
||||
|
||||
func Setregid(rgid int, egid int) (err error) {
|
||||
_, _, e1 := RawSyscall(SYS_SETREGID32, uintptr(rgid), uintptr(egid), 0)
|
||||
if e1 != 0 {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue