]> git.netwichtig.de Git - user/henk/code/inspircd.git/commitdiff
Verify modules providing routed commands are VF_COMMON
authordanieldg <danieldg@e03df62e-2008-0410-955e-edbf42e46eb7>
Wed, 2 Sep 2009 00:42:50 +0000 (00:42 +0000)
committerdanieldg <danieldg@e03df62e-2008-0410-955e-edbf42e46eb7>
Wed, 2 Sep 2009 00:42:50 +0000 (00:42 +0000)
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@11590 e03df62e-2008-0410-955e-edbf42e46eb7

src/modules/m_spanningtree/postcommand.cpp

index 2bf252cc034d7fb2a167920d0b228feec334109e..b3f2f80bb19bf21e3882596a8825a0bebe4c4046 100644 (file)
@@ -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