aboutsummaryrefslogtreecommitdiff
path: root/internal
diff options
context:
space:
mode:
authorJakob Unterwurzacher2025-02-26 21:32:53 +0100
committerJakob Unterwurzacher2025-02-26 21:33:06 +0100
commit07b1bd7ce810c83ed622885b65dbba3dab0f7fbb (patch)
tree8b80c731d386c8b886eeb9daecda20bf57602ac8 /internal
parenta540b0ea1bf5e9742773784600033bcb466e8a04 (diff)
syscallcompat: add docs for Setreuid/Setregid/Setgroups
Diffstat (limited to 'internal')
-rw-r--r--internal/syscallcompat/thread_credentials_linux.go1
-rw-r--r--internal/syscallcompat/thread_credentials_linux_368_arm.go2
-rw-r--r--internal/syscallcompat/thread_credentials_linux_other.go2
3 files changed, 5 insertions, 0 deletions
diff --git a/internal/syscallcompat/thread_credentials_linux.go b/internal/syscallcompat/thread_credentials_linux.go
index 8cfb703..b5ec6cd 100644
--- a/internal/syscallcompat/thread_credentials_linux.go
+++ b/internal/syscallcompat/thread_credentials_linux.go
@@ -23,6 +23,7 @@ import (
"log"
)
+// Setgroups is like setgroups(2) but affects only the current thread
func Setgroups(gids []int) (err error) {
if len(gids) == 0 {
return setgroups(0, nil)
diff --git a/internal/syscallcompat/thread_credentials_linux_368_arm.go b/internal/syscallcompat/thread_credentials_linux_368_arm.go
index e244a15..b39fa09 100644
--- a/internal/syscallcompat/thread_credentials_linux_368_arm.go
+++ b/internal/syscallcompat/thread_credentials_linux_368_arm.go
@@ -10,6 +10,7 @@ import (
// See thread_credentials_linux.go for docs
+// Setreuid is like setreuid(2) but affects only the current thread
func Setreuid(ruid int, euid int) (err error) {
_, _, e1 := unix.RawSyscall(unix.SYS_SETREUID32, uintptr(ruid), uintptr(euid), 0)
if e1 != 0 {
@@ -18,6 +19,7 @@ func Setreuid(ruid int, euid int) (err error) {
return
}
+// Setreuid is like setregid(2) but affects only the current thread
func Setregid(rgid int, egid int) (err error) {
_, _, e1 := unix.RawSyscall(unix.SYS_SETREGID32, uintptr(rgid), uintptr(egid), 0)
if e1 != 0 {
diff --git a/internal/syscallcompat/thread_credentials_linux_other.go b/internal/syscallcompat/thread_credentials_linux_other.go
index ba385b6..ab11c71 100644
--- a/internal/syscallcompat/thread_credentials_linux_other.go
+++ b/internal/syscallcompat/thread_credentials_linux_other.go
@@ -10,6 +10,7 @@ import (
// See thread_credentials_linux.go for docs
+// Setreuid is like setreuid(2) but affects only the current thread
func Setreuid(ruid int, euid int) (err error) {
_, _, e1 := unix.RawSyscall(unix.SYS_SETREUID, uintptr(ruid), uintptr(euid), 0)
if e1 != 0 {
@@ -18,6 +19,7 @@ func Setreuid(ruid int, euid int) (err error) {
return
}
+// Setreuid is like setregid(2) but affects only the current thread
func Setregid(rgid int, egid int) (err error) {
_, _, e1 := unix.RawSyscall(unix.SYS_SETREGID, uintptr(rgid), uintptr(egid), 0)
if e1 != 0 {