aboutsummaryrefslogtreecommitdiff
path: root/vendor/github.com/sid77/drop/syscall/setres.go
diff options
context:
space:
mode:
Diffstat (limited to 'vendor/github.com/sid77/drop/syscall/setres.go')
-rw-r--r--vendor/github.com/sid77/drop/syscall/setres.go17
1 files changed, 17 insertions, 0 deletions
diff --git a/vendor/github.com/sid77/drop/syscall/setres.go b/vendor/github.com/sid77/drop/syscall/setres.go
new file mode 100644
index 0000000..afe43b9
--- /dev/null
+++ b/vendor/github.com/sid77/drop/syscall/setres.go
@@ -0,0 +1,17 @@
+// +build linux
+
+package syscall
+
+import (
+ "syscall"
+)
+
+func Setuid(uid int) error {
+ err := syscall.Setresuid(uid, uid, uid)
+ return err
+}
+
+func Setgid(gid int) error {
+ err := syscall.Setresgid(gid, gid, gid)
+ return err
+}