diff --git a/irc/config.go b/irc/config.go index bc90c1c1..51790546 100644 --- a/irc/config.go +++ b/irc/config.go @@ -51,6 +51,7 @@ type Config struct { Server struct { PassConfig + Password string Name string Database string Listen []string @@ -109,6 +110,11 @@ func LoadConfig(filename string) (config *Config, err error) { return nil, err } + // we need this so PasswordBytes returns the correct info + if config.Server.Password != "" { + config.Server.PassConfig.Password = config.Server.Password + } + if config.Network.Name == "" { return nil, errors.New("Network name missing") } diff --git a/irc/server.go b/irc/server.go index 831cc6fb..a3078744 100644 --- a/irc/server.go +++ b/irc/server.go @@ -341,7 +341,8 @@ func passHandler(server *Server, client *Client, msg ircmsg.IrcMessage) bool { // check the provided password password := []byte(msg.Params[0]) if ComparePassword(server.password, password) != nil { - client.Quit("bad password") + client.Send(nil, server.nameString, ERR_PASSWDMISMATCH, client.nickString, "Password incorrect") + client.Send(nil, server.nameString, "ERROR", "Password incorrect") return true }