summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorpeavey <peavey@e03df62e-2008-0410-955e-edbf42e46eb7>2009-03-13 01:30:53 +0000
committerpeavey <peavey@e03df62e-2008-0410-955e-edbf42e46eb7>2009-03-13 01:30:53 +0000
commit284c22b4b5db3db2b2a84f255edc5b071dbe367f (patch)
tree8d4ace0ee89fbc65f754a94fe1c0f60b6a37894a
parentd131485ce97baf0a33a68ad2febdd769f38200b6 (diff)
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
-rw-r--r--src/mode.cpp6
1 files changed, 4 insertions, 2 deletions
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<std::string>& 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,