From db547020c85850f000ede61cfdcb52f39e8ebc76 Mon Sep 17 00:00:00 2001 From: Shivaram Lingamneni Date: Mon, 7 Feb 2022 19:06:31 -0500 Subject: [PATCH] fix #1906 Having the 'samode' capability made all KICK commands privileged. This appears to have been introduced unintentionally by 42316bc04f4761d and I can't find any discussion of a rationale. Since this goes against our policy that all ircop (as opposed to channel founder) privileges must be invoked explicitly (e.g. SAJOIN, SAMODE), remove this. --- irc/handlers.go | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/irc/handlers.go b/irc/handlers.go index f93ebda8..ecc55119 100644 --- a/irc/handlers.go +++ b/irc/handlers.go @@ -1306,7 +1306,6 @@ func sajoinHandler(server *Server, client *Client, msg ircmsg.Message, rb *Respo // KICK {,} {,} [] func kickHandler(server *Server, client *Client, msg ircmsg.Message, rb *ResponseBuffer) bool { - hasPrivs := client.HasRoleCapabs("samode") channels := strings.Split(msg.Params[0], ",") users := strings.Split(msg.Params[1], ",") if (len(channels) != len(users)) && (len(users) != 1) { @@ -1349,7 +1348,7 @@ func kickHandler(server *Server, client *Client, msg ircmsg.Message, rb *Respons rb.Add(nil, server.name, ERR_NOSUCHNICK, client.nick, utils.SafeErrorParam(kick.nick), client.t("No such nick")) continue } - channel.Kick(client, target, comment, rb, hasPrivs) + channel.Kick(client, target, comment, rb, false) } return false }