diff options
| author | Marin Ivanov <[email protected]> | 2019-03-25 00:46:46 +0200 |
|---|---|---|
| committer | Marin Ivanov <[email protected]> | 2019-03-25 00:53:11 +0200 |
| commit | d8ca90a99e8fed561db245f3e972d893334604f8 (patch) | |
| tree | fc26591d6727a71d29d42b8ae064b3e7982da8a6 /setuid_windows.go | |
| parent | 47971bdbe2ad58ac6749da632febc24c4b12da43 (diff) | |
Allow to drop privileges my changing uid/gid
This feature is only available for unix OSes and allow to setuid and
setgid after creating a listening socket.
Diffstat (limited to 'setuid_windows.go')
| -rw-r--r-- | setuid_windows.go | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/setuid_windows.go b/setuid_windows.go new file mode 100644 index 0000000..63ccc73 --- /dev/null +++ b/setuid_windows.go @@ -0,0 +1,19 @@ +package main + +import ( + "errors" +) + +func setUID(uid uint16) error { + if uid != 0 { + return errors.New("unable to setuid on Windows") + } + return nil +} + +func setGID(uid uint16) error { + if uid != 0 { + return errors.New("unable to setgid on Windows") + } + return nil +} |
