aboutsummaryrefslogtreecommitdiff
path: root/vendor/github.com/sid77/drop/syscall/setres.go
diff options
context:
space:
mode:
authorMarco Bonetti <sid77@users.noreply.github.com>2016-08-26 12:42:18 +0100
committerGitHub <noreply@github.com>2016-08-26 12:42:18 +0100
commitd8098ef9da0b59414227493f6b67f00503b12fd7 (patch)
tree0124ed9d2cf5ef154c2d4923643d9bdcc1edb638 /vendor/github.com/sid77/drop/syscall/setres.go
parentbc966492134279c03458cab2ed2f2f51104ee283 (diff)
parent4028762f4a81a59ccc6d6e5662fa7e341fc74336 (diff)
Merge pull request #27 from nsheridan/sid77/dropPrivileges
First attempt at dropping privileges
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
+}