]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - src/modules/m_spanningtree/postcommand.cpp
Fix detecting secure clients connecting through HAProxy/WEBIRC.
[user/henk/code/inspircd.git] / src / modules / m_spanningtree / postcommand.cpp
index ae98be946520608313c18af76cbe8d61173986fc..c7b4707b3a854804f414b13a1a7e5b024c7cc2d2 100644 (file)
 #include "treeserver.h"
 #include "commandbuilder.h"
 
-void ModuleSpanningTree::OnPostCommand(Command* command, const std::vector<std::string>& parameters, LocalUser* user, CmdResult result, const std::string& original_line)
+void ModuleSpanningTree::OnPostCommand(Command* command, const CommandBase::Params& parameters, LocalUser* user, CmdResult result, bool loop)
 {
        if (result == CMD_SUCCESS)
                Utils->RouteCommand(NULL, command, parameters, user);
 }
 
-void SpanningTreeUtilities::RouteCommand(TreeServer* origin, CommandBase* thiscmd, const parameterlist& parameters, User* user)
+void SpanningTreeUtilities::RouteCommand(TreeServer* origin, CommandBase* thiscmd, const CommandBase::Params& parameters, User* user)
 {
        const std::string& command = thiscmd->name;
        RouteDescriptor routing = thiscmd->GetRouting(user, parameters);
@@ -51,10 +51,12 @@ void SpanningTreeUtilities::RouteCommand(TreeServer* origin, CommandBase* thiscm
                sdest = static_cast<TreeServer*>(routing.server);
                if (!sdest)
                {
-                       sdest = FindServer(routing.serverdest);
+                       // Assume the command handler already validated routing.serverdest and have only returned success if the target is something that the
+                       // user executing the command is allowed to look up e.g. target is not an uuid if user is local.
+                       sdest = FindRouteTarget(routing.serverdest);
                        if (!sdest)
                        {
-                               ServerInstance->Logs->Log(MODNAME, LOG_DEFAULT, "Trying to route %s%s to nonexistant server %s", (encap ? "ENCAP " : ""), command.c_str(), routing.serverdest.c_str());
+                               ServerInstance->Logs->Log(MODNAME, LOG_DEFAULT, "Trying to route %s%s to nonexistent server %s", (encap ? "ENCAP " : ""), command.c_str(), routing.serverdest.c_str());
                                return;
                        }
                }