mirror of
https://github.com/adnanh/webhook.git
synced 2026-07-26 16:54:16 +08:00
77159d9db6
Only applicable on unix systems, although Go doesn't support Linux at this time.
22 lines
243 B
Go
22 lines
243 B
Go
// +build !windows,!linux
|
|
|
|
package main
|
|
|
|
import (
|
|
"syscall"
|
|
)
|
|
|
|
func dropPrivileges(uid, gid int) error {
|
|
err := syscall.Setgid(gid)
|
|
if err != nil {
|
|
return err
|
|
}
|
|
|
|
err = syscall.Setuid(uid)
|
|
if err != nil {
|
|
return err
|
|
}
|
|
|
|
return nil
|
|
}
|