mirror of
https://github.com/rwinkhart/sys.git
synced 2026-08-29 21:36:43 -04:00
unix: add new setfsuid/setfsgid wrappers
Added SetfsgidRetGid and SetfsuidRetUid wrappers for corresponding syscalls, both returning previous gid or uid set. Fixes golang/go#36649 Change-Id: I95176f4442258ca68db79cf967fbf0bbf0a57acf Reviewed-on: https://go-review.googlesource.com/c/sys/+/215579 Run-TryBot: Tobias Klauser <tobias.klauser@gmail.com> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Tobias Klauser <tobias.klauser@gmail.com> Reviewed-by: Ian Lance Taylor <iant@golang.org>
This commit is contained in:
committed by
Ian Lance Taylor
parent
34d275377b
commit
e047566fdf
@@ -2137,8 +2137,9 @@ func sendfile(outfd int, infd int, offset *int64, count int) (written int, err e
|
||||
|
||||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
||||
|
||||
func Setfsgid(gid int) (err error) {
|
||||
_, _, e1 := Syscall(SYS_SETFSGID, uintptr(gid), 0, 0)
|
||||
func setfsgid(gid int) (prev int, err error) {
|
||||
r0, _, e1 := Syscall(SYS_SETFSGID, uintptr(gid), 0, 0)
|
||||
prev = int(r0)
|
||||
if e1 != 0 {
|
||||
err = errnoErr(e1)
|
||||
}
|
||||
@@ -2147,8 +2148,9 @@ func Setfsgid(gid int) (err error) {
|
||||
|
||||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
||||
|
||||
func Setfsuid(uid int) (err error) {
|
||||
_, _, e1 := Syscall(SYS_SETFSUID, uintptr(uid), 0, 0)
|
||||
func setfsuid(uid int) (prev int, err error) {
|
||||
r0, _, e1 := Syscall(SYS_SETFSUID, uintptr(uid), 0, 0)
|
||||
prev = int(r0)
|
||||
if e1 != 0 {
|
||||
err = errnoErr(e1)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user