Allow Linux setuid/setgid

This commit allows webhook to setuid/setgid when running on Linux.

Tested with:

go get -d

CGO_ENABLED=0 go build -ldflags="-s -w"

Correctly compiled, ran, setuid/setgid properly, and answered hook requests.
This commit is contained in:
christopher-conley 2023-07-22 23:00:50 -04:00
parent f187592147
commit f108a2b38e
4 changed files with 6 additions and 6 deletions

View file

@ -1,4 +1,4 @@
// +build linux windows
// +build windows
package main

View file

@ -1,4 +1,4 @@
// +build !windows,!linux
// +build linux !windows
package main

4
go.mod
View file

@ -11,8 +11,8 @@ require (
github.com/gofrs/uuid v3.2.0+incompatible
github.com/gorilla/mux v1.7.3
github.com/kr/pretty v0.1.0 // indirect
golang.org/x/net v0.0.0-20191209160850-c0dbc17a3553 // indirect
golang.org/x/sys v0.0.0-20191228213918-04cbcbbfeed8
golang.org/x/net v0.7.0 // indirect
golang.org/x/sys v0.7.0
gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15 // indirect
gopkg.in/fsnotify.v1 v1.4.2
gopkg.in/yaml.v2 v2.0.0-20170812160011-eb3733d160e7 // indirect

4
vendor/modules.txt vendored
View file

@ -21,9 +21,9 @@ github.com/gofrs/uuid
github.com/gorilla/mux
# github.com/kr/pretty v0.1.0
## explicit
# golang.org/x/net v0.0.0-20191209160850-c0dbc17a3553
# golang.org/x/net v0.7.0
## explicit
# golang.org/x/sys v0.0.0-20191228213918-04cbcbbfeed8
# golang.org/x/sys v0.7.0
## explicit
golang.org/x/sys/unix
golang.org/x/sys/windows