server: Check for channel permissions when renaming channels

This commit is contained in:
Daniel Oaks 2017-06-04 20:06:11 -06:00
parent 0f8ab4eaec
commit 4128ff6137
1 changed files with 6 additions and 0 deletions

View File

@ -819,6 +819,12 @@ func renameHandler(server *Server, client *Client, msg ircmsg.IrcMessage) bool {
return false
}
//TODO(dan): allow IRCops to do this?
if !channel.ClientIsAtLeast(client, Operator) {
client.Send(nil, server.name, ERR_CHANOPRIVSNEEDED, client.nick, oldName, "Only chanops can rename channels")
return false
}
channel.membersMutex.Lock()
defer channel.membersMutex.Unlock()