downstream: fail on client or network name mismatch
This probably indicates a mis-configuration.
This commit is contained in:
parent
348e6da1fc
commit
8421c27544
@ -1290,9 +1290,19 @@ func (dc *downstreamConn) register(ctx context.Context) error {
|
|||||||
_, fallbackClientName, fallbackNetworkName := unmarshalUsername(dc.rawUsername)
|
_, fallbackClientName, fallbackNetworkName := unmarshalUsername(dc.rawUsername)
|
||||||
if dc.clientName == "" {
|
if dc.clientName == "" {
|
||||||
dc.clientName = fallbackClientName
|
dc.clientName = fallbackClientName
|
||||||
|
} else if dc.clientName != fallbackClientName {
|
||||||
|
return ircError{&irc.Message{
|
||||||
|
Command: irc.ERR_ERRONEUSNICKNAME,
|
||||||
|
Params: []string{dc.nick, "Client name mismatch in usernames"},
|
||||||
|
}}
|
||||||
}
|
}
|
||||||
if dc.networkName == "" {
|
if dc.networkName == "" {
|
||||||
dc.networkName = fallbackNetworkName
|
dc.networkName = fallbackNetworkName
|
||||||
|
} else if dc.networkName != fallbackNetworkName {
|
||||||
|
return ircError{&irc.Message{
|
||||||
|
Command: irc.ERR_ERRONEUSNICKNAME,
|
||||||
|
Params: []string{dc.nick, "Network name mismatch in usernames"},
|
||||||
|
}}
|
||||||
}
|
}
|
||||||
|
|
||||||
dc.registered = true
|
dc.registered = true
|
||||||
|
Loading…
Reference in New Issue
Block a user