inspircd

A modular C++ IRC daemon (ircd). https://www.inspircd.org/
Log | Files | Refs | README

commit 4818b1bc1b0dd8560b0c83901aa33ecaf6fb1275
parent e84858dc7f1efdfb76efc1e115e6999fd222af74
Author: Peter Powell <petpow@saberuk.com>
Date:   Mon, 28 Jan 2019 16:45:14 +0000

Fix not checking for server names case insensitively.

Diffstat:
Msrc/coremods/core_info/cmd_admin.cpp | 2+-
Msrc/coremods/core_info/cmd_info.cpp | 2+-
Msrc/coremods/core_info/cmd_modules.cpp | 2+-
Msrc/coremods/core_info/cmd_motd.cpp | 2+-
Msrc/coremods/core_info/cmd_time.cpp | 2+-
Msrc/coremods/core_stats.cpp | 2+-
Msrc/modules/m_check.cpp | 2+-
Msrc/modules/m_opermotd.cpp | 2+-
8 files changed, 8 insertions(+), 8 deletions(-)

diff --git a/src/coremods/core_info/cmd_admin.cpp b/src/coremods/core_info/cmd_admin.cpp @@ -32,7 +32,7 @@ CommandAdmin::CommandAdmin(Module* parent) */ CmdResult CommandAdmin::Handle(User* user, const Params& parameters) { - if (parameters.size() > 0 && parameters[0] != ServerInstance->Config->ServerName) + if (parameters.size() > 0 && !irc::equals(parameters[0], ServerInstance->Config->ServerName)) return CMD_SUCCESS; user->WriteRemoteNumeric(RPL_ADMINME, InspIRCd::Format("Administrative info for %s", ServerInstance->Config->ServerName.c_str())); if (!AdminName.empty()) diff --git a/src/coremods/core_info/cmd_info.cpp b/src/coremods/core_info/cmd_info.cpp @@ -78,7 +78,7 @@ static const char* const lines[] = { */ CmdResult CommandInfo::Handle(User* user, const Params& parameters) { - if (parameters.size() > 0 && parameters[0] != ServerInstance->Config->ServerName) + if (parameters.size() > 0 && !irc::equals(parameters[0], ServerInstance->Config->ServerName)) return CMD_SUCCESS; int i=0; diff --git a/src/coremods/core_info/cmd_modules.cpp b/src/coremods/core_info/cmd_modules.cpp @@ -42,7 +42,7 @@ CmdResult CommandModules::Handle(User* user, const Params& parameters) { // Don't ask remote servers about their modules unless the local user asking is an oper // 2.0 asks anyway, so let's handle that the same way - bool for_us = (parameters.empty() || parameters[0] == ServerInstance->Config->ServerName); + bool for_us = (parameters.empty() || irc::equals(parameters[0], ServerInstance->Config->ServerName)); if ((!for_us) || (!IS_LOCAL(user))) { if (!user->IsOper()) diff --git a/src/coremods/core_info/cmd_motd.cpp b/src/coremods/core_info/cmd_motd.cpp @@ -31,7 +31,7 @@ CommandMotd::CommandMotd(Module* parent) */ CmdResult CommandMotd::Handle(User* user, const Params& parameters) { - if (parameters.size() > 0 && parameters[0] != ServerInstance->Config->ServerName) + if (parameters.size() > 0 && !irc::equals(parameters[0], ServerInstance->Config->ServerName)) { // Give extra penalty if a non-oper queries the /MOTD of a remote server LocalUser* localuser = IS_LOCAL(user); diff --git a/src/coremods/core_info/cmd_time.cpp b/src/coremods/core_info/cmd_time.cpp @@ -29,7 +29,7 @@ CommandTime::CommandTime(Module* parent) CmdResult CommandTime::Handle(User* user, const Params& parameters) { - if (parameters.size() > 0 && parameters[0] != ServerInstance->Config->ServerName) + if (parameters.size() > 0 && !irc::equals(parameters[0], ServerInstance->Config->ServerName)) return CMD_SUCCESS; user->WriteRemoteNumeric(RPL_TIME, ServerInstance->Config->ServerName, InspIRCd::TimeString(ServerInstance->Time())); diff --git a/src/coremods/core_stats.cpp b/src/coremods/core_stats.cpp @@ -378,7 +378,7 @@ void CommandStats::DoStats(Stats::Context& stats) CmdResult CommandStats::Handle(User* user, const Params& parameters) { - if (parameters.size() > 1 && parameters[1] != ServerInstance->Config->ServerName) + if (parameters.size() > 1 && !irc::equals(parameters[1], ServerInstance->Config->ServerName)) { // Give extra penalty if a non-oper does /STATS <remoteserver> LocalUser* localuser = IS_LOCAL(user); diff --git a/src/modules/m_check.cpp b/src/modules/m_check.cpp @@ -142,7 +142,7 @@ class CommandCheck : public Command CmdResult Handle(User* user, const Params& parameters) CXX11_OVERRIDE { - if (parameters.size() > 1 && parameters[1] != ServerInstance->Config->ServerName) + if (parameters.size() > 1 && !irc::equals(parameters[1], ServerInstance->Config->ServerName)) return CMD_SUCCESS; User *targuser; diff --git a/src/modules/m_opermotd.cpp b/src/modules/m_opermotd.cpp @@ -36,7 +36,7 @@ class CommandOpermotd : public Command CmdResult Handle(User* user, const Params& parameters) CXX11_OVERRIDE { - if ((parameters.empty()) || (parameters[0] == ServerInstance->Config->ServerName)) + if ((parameters.empty()) || (irc::equals(parameters[0], ServerInstance->Config->ServerName))) ShowOperMOTD(user); return CMD_SUCCESS; }