mirror of
https://github.com/rwinkhart/sys.git
synced 2026-08-28 04:46:44 -04:00
unix: fix Setfsuid and Setfsgid return values
setfsuid(2) and setfsgid(2) both return an int value that indicates the previous fsuid or fsgid set. This change makes unix.Setfsgid() and unix.Setfsuid() return these values too instead of returning only an error. Fixes golang/go#36649 Change-Id: I56cbb49d7485023b6b04f7b95e8f675473241d8c Reviewed-on: https://go-review.googlesource.com/c/sys/+/215240 Run-TryBot: Tobias Klauser <tobias.klauser@gmail.com> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Tobias Klauser <tobias.klauser@gmail.com>
This commit is contained in:
committed by
Tobias Klauser
parent
59e60aa80a
commit
94506bca4f
@@ -2051,8 +2051,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)
|
||||
}
|
||||
@@ -2061,8 +2062,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