summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorbrain <brain@e03df62e-2008-0410-955e-edbf42e46eb7>2006-08-23 21:36:54 +0000
committerbrain <brain@e03df62e-2008-0410-955e-edbf42e46eb7>2006-08-23 21:36:54 +0000
commit5e3d719f94d8166219802691d50ab06e260a6d09 (patch)
tree7c337324fb7a5100bfc3932b9fae24131782f8e5 /src
parentea3ba4bfd1b072b4f14fb588286eedd0ea8c1d22 (diff)
Check for illegal mode prefixes in AddMode (':' and ',')
We should *probably* check to make sure their rank value doesnt conflict with another modules, too git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@5003 e03df62e-2008-0410-955e-edbf42e46eb7
Diffstat (limited to 'src')
-rw-r--r--src/mode.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/mode.cpp b/src/mode.cpp
index 281fb6ac8..c7d66cd46 100644
--- a/src/mode.cpp
+++ b/src/mode.cpp
@@ -569,6 +569,12 @@ bool ModeParser::AddMode(ModeHandler* mh, unsigned const char modeletter)
if ((mh->GetModeChar() < 'A') || (mh->GetModeChar() > 'z'))
return false;
+ /* A mode prefix of ',' is not acceptable, it would fuck up server to server.
+ * A mode prefix of ':' will fuck up both server to server, and client to server.
+ */
+ if ((mh->GetPrefix() == ',') || (mh->GetPrefix() == ':'))
+ return false;
+
mh->GetModeType() == MODETYPE_USER ? mask = MASK_USER : mask = MASK_CHANNEL;
pos = (mh->GetModeChar()-65) | mask;