Only send configuration updates to the channel if there is a channel to send it to - otherwise it hangs forever...

This commit is contained in:
Ola Bini 2020-01-14 14:35:28 +00:00
parent ef96dd74e5
commit c109af8d88
No known key found for this signature in database
GPG key ID: 6786A150F6A2B28F

View file

@ -192,7 +192,9 @@ func (server *Server) setConfigPassword(key, password string) {
// Could be racy, but shouldn't really matter...
val := "sha1$" + salt + "$" + digest
server.cfg.Set(key, val)
server.cfgUpdate <- &KeyValuePair{Key: key, Value: val}
if server.cfgUpdate != nil {
server.cfgUpdate <- &KeyValuePair{Key: key, Value: val}
}
}
// Set password as the new SuperUser password
@ -550,11 +552,10 @@ func (server *Server) handleAuthenticate(client *Client, msg *Message) {
if auth.Password == nil {
client.RejectAuth(mumbleproto.Reject_WrongServerPW, "Invalid server password")
return
} else {
if !server.checkServerPassword(*auth.Password) {
client.RejectAuth(mumbleproto.Reject_WrongServerPW, "Invalid server password")
return
}
}
if !server.checkServerPassword(*auth.Password) {
client.RejectAuth(mumbleproto.Reject_WrongServerPW, "Invalid server password")
return
}
}