mirror of
https://github.com/minio/minio.git
synced 2025-04-21 19:14:39 -04:00
server: forbid zero port in address flag since it confuses clients and (#3318)
This commit is contained in:
parent
1d4ac4b084
commit
41a3a9e402
@ -369,6 +369,12 @@ func serverMain(c *cli.Context) {
|
|||||||
// Check if requested port is available.
|
// Check if requested port is available.
|
||||||
host, portStr, err := net.SplitHostPort(serverAddr)
|
host, portStr, err := net.SplitHostPort(serverAddr)
|
||||||
fatalIf(err, "Unable to parse %s.", serverAddr)
|
fatalIf(err, "Unable to parse %s.", serverAddr)
|
||||||
|
if portStr == "0" || portStr == "" {
|
||||||
|
// Port zero or empty means use requested to choose any freely available
|
||||||
|
// port. Avoid this since it won't work with any configured clients,
|
||||||
|
// can lead to serious loss of availability.
|
||||||
|
fatalIf(errInvalidArgument, "Invalid port `%s`, please use `--address` to pick a specific port", portStr)
|
||||||
|
}
|
||||||
globalMinioHost = host
|
globalMinioHost = host
|
||||||
|
|
||||||
// Check if requested port is available.
|
// Check if requested port is available.
|
||||||
|
Loading…
x
Reference in New Issue
Block a user