Pull request: all: support setgid, setuid on unix

Updates #2763.

Squashed commit of the following:

commit bd2077c6569b53ae341a58aa73de6063d7037e8e
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date:   Fri Jun 4 16:25:17 2021 +0300

    all: move rlimit_nofile, imp docs

commit ba95d4ab7c722bf83300d626a598aface37539ad
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date:   Fri Jun 4 15:12:23 2021 +0300

    all: support setgid, setuid on unix
This commit is contained in:
Ainar Garipov
2021-06-04 16:35:34 +03:00
parent 3b87478470
commit 48c44c29ab
14 changed files with 283 additions and 31 deletions

View File

@@ -5,7 +5,6 @@
package aghos
import (
"fmt"
"syscall"
"golang.org/x/sys/windows"
@@ -16,7 +15,7 @@ func canBindPrivilegedPorts() (can bool, err error) {
}
func setRlimit(val uint64) (err error) {
return ErrUnsupported
return Unsupported("setrlimit")
}
func haveAdminRights() (bool, error) {
@@ -41,7 +40,7 @@ func haveAdminRights() (bool, error) {
}
func sendProcessSignal(pid int, sig syscall.Signal) error {
return fmt.Errorf("not supported on Windows")
return Unsupported("kill")
}
func isOpenWrt() (ok bool) {