From 4128ff61370e629542f64e2d674282aa5c75f74f Mon Sep 17 00:00:00 2001 From: Daniel Oaks Date: Sun, 4 Jun 2017 20:06:11 -0600 Subject: [PATCH] server: Check for channel permissions when renaming channels --- irc/server.go | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/irc/server.go b/irc/server.go index e8937c72..d82a72d6 100644 --- a/irc/server.go +++ b/irc/server.go @@ -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()