fix(server): allow to bind on a random port
This commit is contained in:
@@ -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)
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user