diff options
Diffstat (limited to 'src/mode.cpp')
-rw-r--r-- | src/mode.cpp | 14 |
1 files changed, 14 insertions, 0 deletions
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) { |