summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorbrain <brain@e03df62e-2008-0410-955e-edbf42e46eb7>2006-07-08 15:14:11 +0000
committerbrain <brain@e03df62e-2008-0410-955e-edbf42e46eb7>2006-07-08 15:14:11 +0000
commitd2cc26fb379dca9c74c6068bc33aaaae6beece6e (patch)
treea2f9f1520fa49d4261edda2ee4193f92cbb349ec
parent5c45abc3fb265d745b7ae0e6262701e78cc0275c (diff)
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
-rw-r--r--src/mode.cpp14
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)
{