From 284c22b4b5db3db2b2a84f255edc5b071dbe367f Mon Sep 17 00:00:00 2001 From: peavey Date: Fri, 13 Mar 2009 01:30:53 +0000 Subject: Follow-up fix to r11081. Escalate minimum privileges from '%' to '@' if halfops are disabled by configuration. Possibly TODO: better handling of minimum privs after RC freeze is over. git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@11212 e03df62e-2008-0410-955e-edbf42e46eb7 --- src/mode.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/mode.cpp b/src/mode.cpp index d9c5c9d2b..748e305a3 100644 --- a/src/mode.cpp +++ b/src/mode.cpp @@ -68,6 +68,8 @@ bool ModeHandler::IsListMode() char ModeHandler::GetNeededPrefix() { + if (prefixneeded == '%' && !ServerInstance->Config->AllowHalfop) + return '@'; return prefixneeded; } @@ -612,10 +614,10 @@ void ModeParser::Process(const std::vector& parameters, User *user, /* If the mode defined by the handler is not '\0', but the handler for it * cannot be found, they probably dont have the right module loaded to implement * the prefix they want to compare the mode against, e.g. '&' for m_chanprotect. - * Revert to checking against the minimum core prefix, '%'. + * Revert to checking against the minimum core prefix, '%' or '@'. */ if (needed && !prefixmode) - prefixmode = FindPrefix('%'); + prefixmode = ServerInstance->Config->AllowHalfop ? FindPrefix('%') : FindPrefix('@'); unsigned int neededrank = prefixmode->GetPrefixRank(); /* Compare our rank on the channel against the rank of the required prefix, -- cgit v1.2.3