From 533f17b3b02b9596a6be655f6d00f717b679d02e Mon Sep 17 00:00:00 2001 From: David Anderson Date: Wed, 16 Sep 2009 22:37:20 -0700 Subject: [PATCH] Block plugins from registering "sm" command (bug 4013, r=pred). --- core/smn_console.cpp | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/core/smn_console.cpp b/core/smn_console.cpp index 0b3ad242..4dc9951a 100644 --- a/core/smn_console.cpp +++ b/core/smn_console.cpp @@ -665,6 +665,12 @@ static cell_t sm_RegServerCmd(IPluginContext *pContext, const cell_t *params) IPluginFunction *pFunction; pContext->LocalToString(params[1], &name); + + if (strcasecmp(name, "sm") == 0) + { + return pContext->ThrowNativeError("Cannot override \"sm\" command"); + } + pContext->LocalToString(params[3], &help); pFunction = pContext->GetFunctionById(params[2]); @@ -687,6 +693,12 @@ static cell_t sm_RegConsoleCmd(IPluginContext *pContext, const cell_t *params) IPluginFunction *pFunction; pContext->LocalToString(params[1], &name); + + if (strcasecmp(name, "sm") == 0) + { + return pContext->ThrowNativeError("Cannot override \"sm\" command"); + } + pContext->LocalToString(params[3], &help); pFunction = pContext->GetFunctionById(params[2]); @@ -712,6 +724,12 @@ static cell_t sm_RegAdminCmd(IPluginContext *pContext, const cell_t *params) int cmdflags = params[6]; pContext->LocalToString(params[1], &name); + + if (strcasecmp(name, "sm") == 0) + { + return pContext->ThrowNativeError("Cannot override \"sm\" command"); + } + pContext->LocalToString(params[4], &help); pContext->LocalToString(params[5], (char **)&group); pFunction = pContext->GetFunctionById(params[2]);