From d2cc26fb379dca9c74c6068bc33aaaae6beece6e Mon Sep 17 00:00:00 2001 From: brain Date: Sat, 8 Jul 2006 15:14:11 +0000 Subject: Put back security checks so non-ops cant set modes again :p git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@4167 e03df62e-2008-0410-955e-edbf42e46eb7 --- src/mode.cpp | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'src') diff --git a/src/mode.cpp b/src/mode.cpp index ac65ee47b..247ef2edd 100644 --- a/src/mode.cpp +++ b/src/mode.cpp @@ -348,6 +348,20 @@ void ModeParser::Process(char **parameters, int pcnt, userrec *user, bool server log(DEBUG,"Target type is CHANNEL"); type = MODETYPE_CHANNEL; mask = MASK_CHANNEL; + + /* Extra security checks on channel modes + * (e.g. are they a (half)op? + */ + + if (((!is_uline(user->server)) && (!servermode)) || (cstatus(user, targetchannel) < STATUS_HOP)) + { + /* Not enough permission: + * NOT a uline and NOT a servermode, + * OR, NOT halfop or above. + */ + WriteServ(user->fd,"482 %s %s :You're not a channel (half)operator",user->nick, targetchannel->name); + return; + } } else if (targetuser) { -- cgit v1.2.3