From 5e3d719f94d8166219802691d50ab06e260a6d09 Mon Sep 17 00:00:00 2001 From: brain Date: Wed, 23 Aug 2006 21:36:54 +0000 Subject: 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 --- src/mode.cpp | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'src/mode.cpp') 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; -- cgit v1.2.3