From 1b213e678b6e9c3e2ddefdeee44de18e98e05550 Mon Sep 17 00:00:00 2001 From: danieldg Date: Wed, 2 Sep 2009 00:42:50 +0000 Subject: Verify modules providing routed commands are VF_COMMON git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@11590 e03df62e-2008-0410-955e-edbf42e46eb7 --- src/modules/m_spanningtree/postcommand.cpp | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'src/modules/m_spanningtree') diff --git a/src/modules/m_spanningtree/postcommand.cpp b/src/modules/m_spanningtree/postcommand.cpp index 2bf252cc0..b3f2f80bb 100644 --- a/src/modules/m_spanningtree/postcommand.cpp +++ b/src/modules/m_spanningtree/postcommand.cpp @@ -33,6 +33,15 @@ void ModuleSpanningTree::OnPostCommand(const std::string &command, const std::ve { /* Safe, we know its non-null because IsValidModuleCommand returned true */ Command* thiscmd = ServerInstance->Parser->GetHandler(command); + + Module* srcmodule = ServerInstance->Modules->Find(thiscmd->source); + + if (srcmodule && !(srcmodule->GetVersion().Flags & VF_COMMON)) { + ServerInstance->Logs->Log("m_spanningtree",ERROR,"Routed command %s from non-VF_COMMON module %s", + command.c_str(), thiscmd->source.c_str()); + return; + } + // this bit of code cleverly routes all module commands // to all remote severs *automatically* so that modules // can just handle commands locally, without having -- cgit v1.2.3