fix(server): allow to bind on a random port

This commit is contained in:
Quentin McGaw
2022-01-29 14:19:02 +00:00
parent e7b0f4c6be
commit 53952b143f

View File

@@ -33,7 +33,7 @@ func (c ControlServer) validate() (err error) {
uid := os.Getuid() uid := os.Getuid()
const maxPrivilegedPort = 1023 const maxPrivilegedPort = 1023
if uid != 0 && port <= maxPrivilegedPort { if uid != 0 && port != 0 && port <= maxPrivilegedPort {
return fmt.Errorf("%w: %d when running with user ID %d", return fmt.Errorf("%w: %d when running with user ID %d",
ErrControlServerPrivilegedPort, port, uid) ErrControlServerPrivilegedPort, port, uid)
} }