aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorGravatar Sadie Powell2021-05-11 03:53:43 +0100
committerGravatar Sadie Powell2021-05-11 04:07:45 +0100
commit3ca912ad71cdc4004401e0977be73c674bb91fbc (patch)
treecf57b43229becfc3d9c8532a2d4f18f095f024ec /src
parentOptimise building the link data string. (diff)
parentSend ERR_BADCHANMASK when trying to OJOIN/SAJOIN an invalid channel. (diff)
downloadinspircd++-3ca912ad71cdc4004401e0977be73c674bb91fbc.tar.gz
inspircd++-3ca912ad71cdc4004401e0977be73c674bb91fbc.tar.bz2
inspircd++-3ca912ad71cdc4004401e0977be73c674bb91fbc.zip
Merge branch 'insp3' into master.
Diffstat (limited to 'src')
-rw-r--r--src/configparser.cpp2
-rw-r--r--src/configreader.cpp4
-rw-r--r--src/coremods/core_dns.cpp6
-rw-r--r--src/coremods/core_info/cmd_modules.cpp3
-rw-r--r--src/coremods/core_reloadmodule.cpp8
-rw-r--r--src/coremods/core_serialize_rfc.cpp2
-rw-r--r--src/coremods/core_stub.cpp2
-rw-r--r--src/coremods/core_whois.cpp4
-rw-r--r--src/helperfuncs.cpp2
-rw-r--r--src/mode.cpp4
-rw-r--r--src/modules.cpp6
-rw-r--r--src/modules/extra/m_pgsql.cpp8
-rw-r--r--src/modules/extra/m_ssl_gnutls.cpp4
-rw-r--r--src/modules/extra/m_ssl_mbedtls.cpp2
-rw-r--r--src/modules/m_callerid.cpp2
-rw-r--r--src/modules/m_cban.cpp4
-rw-r--r--src/modules/m_classban.cpp4
-rw-r--r--src/modules/m_clones.cpp2
-rw-r--r--src/modules/m_dccallow.cpp2
-rw-r--r--src/modules/m_haproxy.cpp2
-rw-r--r--src/modules/m_hidemode.cpp2
-rw-r--r--src/modules/m_httpd.cpp2
-rw-r--r--src/modules/m_httpd_acl.cpp2
-rw-r--r--src/modules/m_ircv3.cpp4
-rw-r--r--src/modules/m_ircv3_batch.cpp4
-rw-r--r--src/modules/m_ldapauth.cpp2
-rw-r--r--src/modules/m_monitor.cpp8
-rw-r--r--src/modules/m_nationalchars.cpp8
-rw-r--r--src/modules/m_ojoin.cpp2
-rw-r--r--src/modules/m_remove.cpp4
-rw-r--r--src/modules/m_repeat.cpp4
-rw-r--r--src/modules/m_rline.cpp2
-rw-r--r--src/modules/m_sajoin.cpp2
-rw-r--r--src/modules/m_sasl.cpp10
-rw-r--r--src/modules/m_sha1.cpp2
-rw-r--r--src/modules/m_shun.cpp2
-rw-r--r--src/modules/m_spanningtree/main.cpp2
-rw-r--r--src/modules/m_spanningtree/nickcollide.cpp3
-rw-r--r--src/modules/m_spanningtree/override_squit.cpp2
-rw-r--r--src/modules/m_spanningtree/treesocket.h4
-rw-r--r--src/modules/m_spanningtree/utils.h2
-rw-r--r--src/modules/m_sslinfo.cpp5
-rw-r--r--src/modules/m_svshold.cpp2
-rw-r--r--src/modules/m_websocket.cpp10
-rw-r--r--src/modules/m_xline_db.cpp8
-rw-r--r--src/xline.cpp2
46 files changed, 90 insertions, 83 deletions
diff --git a/src/configparser.cpp b/src/configparser.cpp
index 2d173d650..7c0cb7f4e 100644
--- a/src/configparser.cpp
+++ b/src/configparser.cpp
@@ -491,7 +491,7 @@ bool ConfigTag::readString(const std::string& key, std::string& value, bool allo
continue;
value = ivalue;
- if (!allow_lf && (value.find('\n') != std::string::npos))
+ if (!allow_lf && (value.find('\n') != std::string::npos))
{
ServerInstance->Logs.Log("CONFIG", LOG_DEFAULT, "Value of <" + name + ":" + key + "> at " + source.str() +
" contains a linefeed, and linefeeds in this value are not permitted -- stripped to spaces.");
diff --git a/src/configreader.cpp b/src/configreader.cpp
index 29854a9b7..2db989b9a 100644
--- a/src/configreader.cpp
+++ b/src/configreader.cpp
@@ -468,8 +468,8 @@ void ServerConfig::Apply(ServerConfig* old, const std::string &useruid)
auto binds = ConfTags("bind");
if (binds.empty())
- errstr << "Possible configuration error: you have not defined any <bind> blocks." << std::endl
- << "You will need to do this if you want clients to be able to connect!" << std::endl;
+ errstr << "Possible configuration error: you have not defined any <bind> blocks." << std::endl
+ << "You will need to do this if you want clients to be able to connect!" << std::endl;
if (old && valid)
{
diff --git a/src/coremods/core_dns.cpp b/src/coremods/core_dns.cpp
index 270493c3d..029d42eba 100644
--- a/src/coremods/core_dns.cpp
+++ b/src/coremods/core_dns.cpp
@@ -211,7 +211,13 @@ class Packet : public Query
break;
}
default:
+ {
+ if (pos + rdlength > input_size)
+ throw Exception("Unable to skip resource record");
+
+ pos += rdlength;
break;
+ }
}
if (!record.name.empty() && !record.rdata.empty())
diff --git a/src/coremods/core_info/cmd_modules.cpp b/src/coremods/core_info/cmd_modules.cpp
index b489df96e..74083eae9 100644
--- a/src/coremods/core_info/cmd_modules.cpp
+++ b/src/coremods/core_info/cmd_modules.cpp
@@ -62,8 +62,7 @@ CmdResult CommandModules::Handle(User* user, const Params& parameters)
}
bool has_priv = IS_LOCAL(user) && user->HasPrivPermission("servers/auspex");
- const ModuleManager::ModuleMap& mods = ServerInstance->Modules.GetModules();
- for (const auto& [modname, mod] : mods)
+ for (const auto& [modname, mod] : ServerInstance->Modules.GetModules())
{
const char* version = has_priv ? mod->ModuleDLLManager->GetVersion() : "*";
const std::string props = has_priv ? mod->GetPropertyString() : "*";
diff --git a/src/coremods/core_reloadmodule.cpp b/src/coremods/core_reloadmodule.cpp
index dfb55ad37..7d9e6366c 100644
--- a/src/coremods/core_reloadmodule.cpp
+++ b/src/coremods/core_reloadmodule.cpp
@@ -31,10 +31,10 @@ static ClientProtocol::Serializer* dummyserializer;
class DummySerializer : public ClientProtocol::Serializer
{
- bool Parse(LocalUser* user, const std::string& line, ClientProtocol::ParseOutput& parseoutput) override
- {
- return false;
- }
+ bool Parse(LocalUser* user, const std::string& line, ClientProtocol::ParseOutput& parseoutput) override
+ {
+ return false;
+ }
ClientProtocol::SerializedMessage Serialize(const ClientProtocol::Message& msg, const ClientProtocol::TagSelection& tagwl) const override
{
diff --git a/src/coremods/core_serialize_rfc.cpp b/src/coremods/core_serialize_rfc.cpp
index 4df40136b..625ec1cff 100644
--- a/src/coremods/core_serialize_rfc.cpp
+++ b/src/coremods/core_serialize_rfc.cpp
@@ -43,7 +43,7 @@ class RFCSerializer : public ClientProtocol::Serializer
{
}
- bool Parse(LocalUser* user, const std::string& line, ClientProtocol::ParseOutput& parseoutput) override;
+ bool Parse(LocalUser* user, const std::string& line, ClientProtocol::ParseOutput& parseoutput) override;
ClientProtocol::SerializedMessage Serialize(const ClientProtocol::Message& msg, const ClientProtocol::TagSelection& tagwl) const override;
};
diff --git a/src/coremods/core_stub.cpp b/src/coremods/core_stub.cpp
index 1e622107e..2a04ac521 100644
--- a/src/coremods/core_stub.cpp
+++ b/src/coremods/core_stub.cpp
@@ -167,7 +167,7 @@ class CommandUsers
class CoreModStub : public Module
{
private:
- CommandCapab cmdcapab;
+ CommandCapab cmdcapab;
CommandConnect cmdconnect;
CommandLinks cmdlinks;
CommandSquit cmdsquit;
diff --git a/src/coremods/core_whois.cpp b/src/coremods/core_whois.cpp
index fdff04b11..95f5dac49 100644
--- a/src/coremods/core_whois.cpp
+++ b/src/coremods/core_whois.cpp
@@ -78,10 +78,10 @@ class CommandWhois : public SplitCommand
void SendChanList(WhoisContextImpl& whois);
public:
- /** If true then all opers are shown with a generic 'is a server operator' line rather than the oper type. */
+ /** If true then all opers are shown with a generic 'is a server operator' line rather than the oper type. */
bool genericoper;
- /** How to handle private/secret channels in the WHOIS response. */
+ /** How to handle private/secret channels in the WHOIS response. */
SplitWhoisState splitwhois;
diff --git a/src/helperfuncs.cpp b/src/helperfuncs.cpp
index 709dcca17..90d6d20a5 100644
--- a/src/helperfuncs.cpp
+++ b/src/helperfuncs.cpp
@@ -271,7 +271,7 @@ bool InspIRCd::IsSID(const std::string &str)
*/
return ((str.length() == 3) && isdigit(str[0]) &&
((str[1] >= 'A' && str[1] <= 'Z') || isdigit(str[1])) &&
- ((str[2] >= 'A' && str[2] <= 'Z') || isdigit(str[2])));
+ ((str[2] >= 'A' && str[2] <= 'Z') || isdigit(str[2])));
}
/** A lookup table of values for multiplier characters used by
diff --git a/src/mode.cpp b/src/mode.cpp
index ea3e64eb6..bd02ff660 100644
--- a/src/mode.cpp
+++ b/src/mode.cpp
@@ -552,7 +552,7 @@ void ModeParser::CleanMask(std::string &mask)
else if ((pos_of_pling == std::string::npos) && (pos_of_at != std::string::npos))
{
/* Has an @ but no !, its a user@host */
- mask = "*!" + mask;
+ mask = "*!" + mask;
}
else if ((pos_of_pling != std::string::npos) && (pos_of_at == std::string::npos))
{
@@ -734,9 +734,9 @@ std::string ModeParser::GiveModeList(ModeType mt)
for (unsigned char mode = 'A'; mode <= 'z'; mode++)
{
ModeHandler* mh = modehandlers[mt][mode-65];
- /* One parameter when adding */
if (mh)
{
+ /* One parameter when adding */
if (mh->NeedsParam(true))
{
PrefixMode* pm = mh->IsPrefixMode();
diff --git a/src/modules.cpp b/src/modules.cpp
index dc830cc6a..534d5bab0 100644
--- a/src/modules.cpp
+++ b/src/modules.cpp
@@ -146,15 +146,15 @@ void Module::OnChangeIdent(User*, const std::string&) { DetachEvent(I_OnChangeI
void Module::OnAddLine(User*, XLine*) { DetachEvent(I_OnAddLine); }
void Module::OnDelLine(User*, XLine*) { DetachEvent(I_OnDelLine); }
void Module::OnExpireLine(XLine*) { DetachEvent(I_OnExpireLine); }
-void Module::OnCleanup(ExtensionItem::ExtensibleType, Extensible*) { }
+void Module::OnCleanup(ExtensionItem::ExtensibleType, Extensible*) { }
ModResult Module::OnChannelPreDelete(Channel*) { DetachEvent(I_OnChannelPreDelete); return MOD_RES_PASSTHRU; }
void Module::OnChannelDelete(Channel*) { DetachEvent(I_OnChannelDelete); }
void Module::OnBuildNeighborList(User*, IncludeChanList&, std::map<User*,bool>&) { DetachEvent(I_OnBuildNeighborList); }
void Module::OnGarbageCollect() { DetachEvent(I_OnGarbageCollect); }
ModResult Module::OnSetConnectClass(LocalUser* user, std::shared_ptr<ConnectClass> myclass) { DetachEvent(I_OnSetConnectClass); return MOD_RES_PASSTHRU; }
-void Module::OnUserMessage(User*, const MessageTarget&, const MessageDetails&) { DetachEvent(I_OnUserMessage); }
+void Module::OnUserMessage(User*, const MessageTarget&, const MessageDetails&) { DetachEvent(I_OnUserMessage); }
ModResult Module::OnNumeric(User*, const Numeric::Numeric&) { DetachEvent(I_OnNumeric); return MOD_RES_PASSTHRU; }
-ModResult Module::OnAcceptConnection(int, ListenSocket*, irc::sockets::sockaddrs*, irc::sockets::sockaddrs*) { DetachEvent(I_OnAcceptConnection); return MOD_RES_PASSTHRU; }
+ModResult Module::OnAcceptConnection(int, ListenSocket*, irc::sockets::sockaddrs*, irc::sockets::sockaddrs*) { DetachEvent(I_OnAcceptConnection); return MOD_RES_PASSTHRU; }
void Module::OnSetUserIP(LocalUser*) { DetachEvent(I_OnSetUserIP); }
void Module::OnServiceAdd(ServiceProvider&) { DetachEvent(I_OnServiceAdd); }
void Module::OnServiceDel(ServiceProvider&) { DetachEvent(I_OnServiceDel); }
diff --git a/src/modules/extra/m_pgsql.cpp b/src/modules/extra/m_pgsql.cpp
index 9f512a21a..b61b96b3c 100644
--- a/src/modules/extra/m_pgsql.cpp
+++ b/src/modules/extra/m_pgsql.cpp
@@ -185,11 +185,11 @@ class PgSQLresult : public SQL::Result
class SQLConn : public SQL::Provider, public EventHandler
{
public:
- std::shared_ptr<ConfigTag> conf; /* The <database> entry */
+ std::shared_ptr<ConfigTag> conf; /* The <database> entry */
std::deque<QueueItem> queue;
- PGconn* sql = nullptr; /* PgSQL database connection handle */
- SQLstatus status = CWRITE; /* PgSQL database connection status */
- QueueItem qinprog; /* If there is currently a query in progress */
+ PGconn* sql = nullptr; /* PgSQL database connection handle */
+ SQLstatus status = CWRITE; /* PgSQL database connection status */
+ QueueItem qinprog; /* If there is currently a query in progress */
SQLConn(Module* Creator, std::shared_ptr<ConfigTag> tag)
: SQL::Provider(Creator, tag->getString("id"))
diff --git a/src/modules/extra/m_ssl_gnutls.cpp b/src/modules/extra/m_ssl_gnutls.cpp
index 55673ab3a..52003b675 100644
--- a/src/modules/extra/m_ssl_gnutls.cpp
+++ b/src/modules/extra/m_ssl_gnutls.cpp
@@ -37,7 +37,7 @@
/// $PackageInfo: require_system("centos") gnutls-devel pkgconfig
/// $PackageInfo: require_system("darwin") gnutls pkg-config
/// $PackageInfo: require_system("debian") gnutls-bin libgnutls28-dev pkg-config
-/// $PackageInfo: require_system("ubuntu") gnutls-bin libgnutls-dev pkg-config
+/// $PackageInfo: require_system("ubuntu") gnutls-bin libgnutls28-dev pkg-config
#include "inspircd.h"
#include "modules/ssl.h"
@@ -1079,7 +1079,7 @@ class GnuTLSIOHookProvider : public SSLIOHookProvider
GnuTLS::Profile profile;
public:
- GnuTLSIOHookProvider(Module* mod, GnuTLS::Profile::Config& config)
+ GnuTLSIOHookProvider(Module* mod, GnuTLS::Profile::Config& config)
: SSLIOHookProvider(mod, config.name)
, profile(config)
{
diff --git a/src/modules/extra/m_ssl_mbedtls.cpp b/src/modules/extra/m_ssl_mbedtls.cpp
index 8f3b34a2b..7b8313f90 100644
--- a/src/modules/extra/m_ssl_mbedtls.cpp
+++ b/src/modules/extra/m_ssl_mbedtls.cpp
@@ -810,7 +810,7 @@ class mbedTLSIOHookProvider : public SSLIOHookProvider
mbedTLS::Profile profile;
public:
- mbedTLSIOHookProvider(Module* mod, mbedTLS::Profile::Config& config)
+ mbedTLSIOHookProvider(Module* mod, mbedTLS::Profile::Config& config)
: SSLIOHookProvider(mod, config.name)
, profile(config)
{
diff --git a/src/modules/m_callerid.cpp b/src/modules/m_callerid.cpp
index 013055331..8da3dca19 100644
--- a/src/modules/m_callerid.cpp
+++ b/src/modules/m_callerid.cpp
@@ -46,7 +46,7 @@ enum
class callerid_data
{
public:
- typedef insp::flat_set<User*> UserSet;
+ typedef insp::flat_set<User*> UserSet;
typedef std::vector<callerid_data*> CallerIdDataSet;
time_t lastnotify = 0;
diff --git a/src/modules/m_cban.cpp b/src/modules/m_cban.cpp
index 6afba34e4..6bd394e62 100644
--- a/src/modules/m_cban.cpp
+++ b/src/modules/m_cban.cpp
@@ -75,8 +75,6 @@ class CBanFactory : public XLineFactory
public:
CBanFactory() : XLineFactory("CBAN") { }
- /** Generate a CBAN
- */
XLine* Generate(time_t set_time, unsigned long duration, const std::string& source, const std::string& reason, const std::string& xline_specific_mask) override
{
return new CBan(set_time, duration, source, reason, xline_specific_mask);
@@ -204,7 +202,7 @@ class ModuleCBan : public Module, public Stats::EventListener
// Channel is banned.
user->WriteNumeric(ERR_BADCHANNEL, cname, InspIRCd::Format("Channel %s is CBANed: %s", cname.c_str(), rl->reason.c_str()));
ServerInstance->SNO.WriteGlobalSno('a', "%s tried to join %s which is CBANed (%s)",
- user->nick.c_str(), cname.c_str(), rl->reason.c_str());
+ user->nick.c_str(), cname.c_str(), rl->reason.c_str());
return MOD_RES_DENY;
}
diff --git a/src/modules/m_classban.cpp b/src/modules/m_classban.cpp
index a469b5e6f..466fd9d1c 100644
--- a/src/modules/m_classban.cpp
+++ b/src/modules/m_classban.cpp
@@ -56,8 +56,8 @@ class ModuleClassBan
ClassExtBan extban;
public:
- ModuleClassBan()
- : Module(VF_VENDOR | VF_OPTCOMMON, "Adds the n extended ban which check whether users are in a connect class matching the specified glob pattern.")
+ ModuleClassBan()
+ : Module(VF_VENDOR | VF_OPTCOMMON, "Adds the n extended ban which check whether users are in a connect class matching the specified glob pattern.")
, extban(this)
{
}
diff --git a/src/modules/m_clones.cpp b/src/modules/m_clones.cpp
index f59d48a61..fc798a031 100644
--- a/src/modules/m_clones.cpp
+++ b/src/modules/m_clones.cpp
@@ -39,7 +39,7 @@ class CommandClones : public SplitCommand
IRCv3::Batch::Batch batch;
public:
- CommandClones(Module* Creator)
+ CommandClones(Module* Creator)
: SplitCommand(Creator,"CLONES", 1)
, batchmanager(Creator)
, batch("inspircd.org/clones")
diff --git a/src/modules/m_dccallow.cpp b/src/modules/m_dccallow.cpp
index bc5f9763a..36d86fa1d 100644
--- a/src/modules/m_dccallow.cpp
+++ b/src/modules/m_dccallow.cpp
@@ -352,7 +352,7 @@ class CommandDccallow : public Command
void DisplayDCCAllowList(User* user)
{
- // display current DCCALLOW list
+ // display current DCCALLOW list
user->WriteNumeric(RPL_DCCALLOWSTART, "Users on your DCCALLOW list:");
dl = ext.Get(user);
diff --git a/src/modules/m_haproxy.cpp b/src/modules/m_haproxy.cpp
index 42f5a9fc8..96c11a515 100644
--- a/src/modules/m_haproxy.cpp
+++ b/src/modules/m_haproxy.cpp
@@ -110,7 +110,7 @@ struct HAProxyHeader
class HAProxyHookProvider : public IOHookProvider
{
private:
- UserCertificateAPI sslapi;
+ UserCertificateAPI sslapi;
public:
HAProxyHookProvider(Module* mod)
diff --git a/src/modules/m_hidemode.cpp b/src/modules/m_hidemode.cpp
index 906d5de31..5799459c8 100644
--- a/src/modules/m_hidemode.cpp
+++ b/src/modules/m_hidemode.cpp
@@ -89,7 +89,7 @@ class ModeHook : public ClientProtocol::EventHook
const Modes::Change& curr = *i;
if (settings.GetRequiredRank(*curr.mh) <= rank)
{
- // No restriction on who can see this mode or there is one but the member's rank is sufficient
+ // No restriction on who can see this mode or there is one but the member's rank is sufficient
if (modechangelist)
modechangelist->push(curr);
diff --git a/src/modules/m_httpd.cpp b/src/modules/m_httpd.cpp
index 340ac3c5e..64c8065f6 100644
--- a/src/modules/m_httpd.cpp
+++ b/src/modules/m_httpd.cpp
@@ -341,7 +341,7 @@ class HttpServerSocket : public BufferedSocket, public Timer, public insp::intru
{
if (pathsegment == ".")
{
- // Stay at the current level.
+ // Stay at the current level.
continue;
}
diff --git a/src/modules/m_httpd_acl.cpp b/src/modules/m_httpd_acl.cpp
index cca21fbd5..3aaf57bc3 100644
--- a/src/modules/m_httpd_acl.cpp
+++ b/src/modules/m_httpd_acl.cpp
@@ -48,7 +48,7 @@ class ModuleHTTPAccessList : public Module, public HTTPACLEventListener
HTTPdAPI API;
public:
- ModuleHTTPAccessList()
+ ModuleHTTPAccessList()
: Module(VF_VENDOR, "Allows the server administrator to control who can access resources served over HTTP with the httpd module.")
, HTTPACLEventListener(this)
, API(this)
diff --git a/src/modules/m_ircv3.cpp b/src/modules/m_ircv3.cpp
index d9af0f04f..802ca99d9 100644
--- a/src/modules/m_ircv3.cpp
+++ b/src/modules/m_ircv3.cpp
@@ -51,10 +51,10 @@ class JoinHook : public ClientProtocol::EventHook
ClientProtocol::Events::Join extendedjoinmsg;
public:
- const std::string asterisk;
+ const std::string asterisk;
ClientProtocol::EventProvider awayprotoev;
AwayMessage awaymsg;
- Cap::Capability extendedjoincap;
+ Cap::Capability extendedjoincap;
Cap::Capability awaycap;
JoinHook(Module* mod)
diff --git a/src/modules/m_ircv3_batch.cpp b/src/modules/m_ircv3_batch.cpp
index c41b9f395..eac86a705 100644
--- a/src/modules/m_ircv3_batch.cpp
+++ b/src/modules/m_ircv3_batch.cpp
@@ -59,12 +59,12 @@ struct IRCv3::Batch::BatchInfo
class IRCv3::Batch::ManagerImpl : public Manager
{
- typedef std::vector<Batch*> BatchList;
+ typedef std::vector<Batch*> BatchList;
Cap::Capability cap;
ClientProtocol::EventProvider protoevprov;
IntExtItem batchbits;
- BatchList active_batches;
+ BatchList active_batches;
bool unloading = false;
bool ShouldSendTag(LocalUser* user, const ClientProtocol::MessageTagData& tagdata) override
diff --git a/src/modules/m_ldapauth.cpp b/src/modules/m_ldapauth.cpp
index ac8ff442b..4e531a3ca 100644
--- a/src/modules/m_ldapauth.cpp
+++ b/src/modules/m_ldapauth.cpp
@@ -325,7 +325,7 @@ public:
whitelistedcidrs.clear();
requiredattributes.clear();
- base = tag->getString("baserdn");
+ base = tag->getString("baserdn");
attribute = tag->getString("attribute");
killreason = tag->getString("killreason");
vhost = tag->getString("host");
diff --git a/src/modules/m_monitor.cpp b/src/modules/m_monitor.cpp
index d1b10d5f3..4fd656a13 100644
--- a/src/modules/m_monitor.cpp
+++ b/src/modules/m_monitor.cpp
@@ -188,7 +188,7 @@ class IRCv3::Monitor::Manager
}
private:
- typedef std::unordered_map<std::string, Entry, irc::insensitive, irc::StrHashComp> NickHash;
+ typedef std::unordered_map<std::string, Entry, irc::insensitive, irc::StrHashComp> NickHash;
Entry* Find(const std::string& nick)
{
@@ -237,9 +237,9 @@ class IRCv3::Monitor::Manager
return &extdata->list;
}
- NickHash nicks;
- ExtItem ext;
- WatchedList emptywatchedlist;
+ NickHash nicks;
+ ExtItem ext;
+ WatchedList emptywatchedlist;
};
void IRCv3::Monitor::Manager::ExtItem::FromInternal(Extensible* container, const std::string& value) noexcept
diff --git a/src/modules/m_nationalchars.cpp b/src/modules/m_nationalchars.cpp
index cf957afc6..578a36ce3 100644
--- a/src/modules/m_nationalchars.cpp
+++ b/src/modules/m_nationalchars.cpp
@@ -40,7 +40,6 @@ class lwbNickHandler
static bool Call(const std::string&);
};
- /*,m_reverse_additionalUp[256];*/
static unsigned char m_reverse_additional[256],m_additionalMB[256],m_additionalUtf8[256],m_additionalUtf8range[256],m_additionalUtf8interval[256];
char utf8checkrest(unsigned char * mb, unsigned char cnt)
@@ -411,7 +410,7 @@ class ModuleNationalChars : public Module
if (*p == '0')
{
if (p[1] == 'x')
- /* hex with the leading "0x" */
+ /* hex with the leading "0x" */
chartable[i] = symtoi(p + 2, 16);
else
chartable[i] = symtoi(p + 1, 8);
@@ -420,12 +419,13 @@ class ModuleNationalChars : public Module
else if (*p == 'x')
{
chartable[i] = symtoi(p + 1, 16);
- }else /* decimal form */
+ }
+ else /* decimal form */
{
chartable[i] = symtoi(p, 10);
}
}
- else /* plain-text char between '' */
+ else /* plain-text char between '' */
{
if (*(p + 1) == '\\')
{
diff --git a/src/modules/m_ojoin.cpp b/src/modules/m_ojoin.cpp
index 2ee355fc3..1f8a51f41 100644
--- a/src/modules/m_ojoin.cpp
+++ b/src/modules/m_ojoin.cpp
@@ -49,7 +49,7 @@ class CommandOjoin : public SplitCommand
// Make sure the channel name is allowable.
if (!ServerInstance->Channels.IsChannel(parameters[0]))
{
- user->WriteNotice("*** Invalid characters in channel name or name too long");
+ user->WriteNumeric(ERR_BADCHANMASK, parameters[0], "Invalid channel name");
return CmdResult::FAILURE;
}
diff --git a/src/modules/m_remove.cpp b/src/modules/m_remove.cpp
index 5a570b3ad..1829ed0d8 100644
--- a/src/modules/m_remove.cpp
+++ b/src/modules/m_remove.cpp
@@ -45,7 +45,7 @@ class RemoveBase : public Command
ChanModeReference& nokicksmode;
public:
- unsigned int protectedrank;
+ unsigned int protectedrank;
RemoveBase(Module* Creator, bool& snk, ChanModeReference& nkm, const char* cmdn)
: Command(Creator, cmdn, 2, 3)
@@ -109,7 +109,7 @@ class RemoveBase : public Command
{
/* We'll let everyone remove their level and below, eg:
* ops can remove ops, halfops, voices, and those with no mode (no moders actually are set to 1)
- a services target will get a higher level than it's possible for a /remover to get..so they're safe.
+ * a services target will get a higher level than it's possible for a /remover to get..so they're safe.
* Nobody may remove people with >= protectedrank rank.
*/
unsigned int ulevel = channel->GetPrefixValue(user);
diff --git a/src/modules/m_repeat.cpp b/src/modules/m_repeat.cpp
index bcbe18a5a..0b305257f 100644
--- a/src/modules/m_repeat.cpp
+++ b/src/modules/m_repeat.cpp
@@ -30,7 +30,7 @@
class ChannelSettings
{
public:
- enum RepeatAction
+ enum RepeatAction
{
ACT_KICK,
ACT_BLOCK,
@@ -125,7 +125,7 @@ class RepeatMode : public ParamMode<RepeatMode, SimpleExtItem<ChannelSettings> >
}
public:
- ModuleSettings ms;
+ ModuleSettings ms;
SimpleExtItem<MemberInfo> MemberInfoExt;
RepeatMode(Module* Creator)
diff --git a/src/modules/m_rline.cpp b/src/modules/m_rline.cpp
index aa7b94e8f..033f47900 100644
--- a/src/modules/m_rline.cpp
+++ b/src/modules/m_rline.cpp
@@ -210,7 +210,7 @@ class ModuleRLine
, public Stats::EventListener
{
private:
- Regex::EngineReference rxfactory;
+ Regex::EngineReference rxfactory;
RLineFactory f;
CommandRLine r;
bool MatchOnNickChange;
diff --git a/src/modules/m_sajoin.cpp b/src/modules/m_sajoin.cpp
index 8b06d54a4..32a79a90a 100644
--- a/src/modules/m_sajoin.cpp
+++ b/src/modules/m_sajoin.cpp
@@ -66,7 +66,7 @@ class CommandSajoin : public Command
if (IS_LOCAL(user) && !ServerInstance->Channels.IsChannel(channel))
{
/* we didn't need to check this for each character ;) */
- user->WriteNotice("*** Invalid characters in channel name or name too long");
+ user->WriteNumeric(ERR_BADCHANMASK, channel, "Invalid channel name");
return CmdResult::FAILURE;
}
diff --git a/src/modules/m_sasl.cpp b/src/modules/m_sasl.cpp
index 01c441f53..e3d4ce4ef 100644
--- a/src/modules/m_sasl.cpp
+++ b/src/modules/m_sasl.cpp
@@ -287,13 +287,13 @@ class SaslAuthenticator
switch (this->result)
{
- case SASL_OK:
+ case SASL_OK:
this->user->WriteNumeric(RPL_SASLSUCCESS, "SASL authentication successful");
break;
- case SASL_ABORT:
+ case SASL_ABORT:
this->user->WriteNumeric(ERR_SASLABORTED, "SASL authentication aborted");
break;
- case SASL_FAIL:
+ case SASL_FAIL:
this->user->WriteNumeric(ERR_SASLFAIL, "SASL authentication failed");
break;
}
@@ -305,8 +305,8 @@ class SaslAuthenticator
class CommandAuthenticate : public SplitCommand
{
private:
- // The maximum length of an AUTHENTICATE request.
- static const size_t MAX_AUTHENTICATE_SIZE = 400;
+ // The maximum length of an AUTHENTICATE request.
+ static const size_t MAX_AUTHENTICATE_SIZE = 400;
public:
SimpleExtItem<SaslAuthenticator>& authExt;
diff --git a/src/modules/m_sha1.cpp b/src/modules/m_sha1.cpp
index d4cdd9696..0cb87bc66 100644
--- a/src/modules/m_sha1.cpp
+++ b/src/modules/m_sha1.cpp
@@ -166,7 +166,7 @@ class SHA1Context
class SHA1HashProvider : public HashProvider
{
public:
- SHA1HashProvider(Module* mod)
+ SHA1HashProvider(Module* mod)
: HashProvider(mod, "sha1", 20, 64)
{
}
diff --git a/src/modules/m_shun.cpp b/src/modules/m_shun.cpp
index 404ddbb43..43d5d074c 100644
--- a/src/modules/m_shun.cpp
+++ b/src/modules/m_shun.cpp
@@ -42,8 +42,6 @@ class ShunFactory : public XLineFactory
public:
ShunFactory() : XLineFactory("SHUN") { }
- /** Generate a shun
- */
XLine* Generate(time_t set_time, unsigned long duration, const std::string& source, const std::string& reason, const std::string& xline_specific_mask) override
{
return new Shun(set_time, duration, source, reason, xline_specific_mask);
diff --git a/src/modules/m_spanningtree/main.cpp b/src/modules/m_spanningtree/main.cpp
index e8012fc55..4df743b05 100644
--- a/src/modules/m_spanningtree/main.cpp
+++ b/src/modules/m_spanningtree/main.cpp
@@ -146,7 +146,7 @@ void ModuleSpanningTree::ShowLinks(TreeServer* Current, User* user, int hops)
{
if (user->IsOper())
{
- ShowLinks(server, user, hops+1);
+ ShowLinks(server, user, hops+1);
}
}
else
diff --git a/src/modules/m_spanningtree/nickcollide.cpp b/src/modules/m_spanningtree/nickcollide.cpp
index f00ea2b70..0447d9548 100644
--- a/src/modules/m_spanningtree/nickcollide.cpp
+++ b/src/modules/m_spanningtree/nickcollide.cpp
@@ -78,8 +78,7 @@ bool SpanningTreeUtilities::DoCollision(User* u, TreeServer* server, time_t remo
* if ident@ip is equal, and theirs is newer, or
* ident@ip differ, and ours is newer
*/
- if((SamePerson && remotets < localts) ||
- (!SamePerson && remotets > localts))
+ if ((SamePerson && remotets < localts) || (!SamePerson && remotets > localts))
{
// Only remote needs to change
bChangeLocal = false;
diff --git a/src/modules/m_spanningtree/override_squit.cpp b/src/modules/m_spanningtree/override_squit.cpp
index 72d34e87e..b46297b75 100644
--- a/src/modules/m_spanningtree/override_squit.cpp
+++ b/src/modules/m_spanningtree/override_squit.cpp
@@ -54,7 +54,7 @@ ModResult ModuleSpanningTree::HandleSquit(const CommandBase::Params& parameters,
}
else
{
- user->WriteNotice("*** SQUIT: The server \002" + parameters[0] + "\002 does not exist on the network.");
+ user->WriteNotice("*** SQUIT: The server \002" + parameters[0] + "\002 does not exist on the network.");
}
return MOD_RES_DENY;
}
diff --git a/src/modules/m_spanningtree/treesocket.h b/src/modules/m_spanningtree/treesocket.h
index c3a03999e..89c2b9aec 100644
--- a/src/modules/m_spanningtree/treesocket.h
+++ b/src/modules/m_spanningtree/treesocket.h
@@ -55,10 +55,10 @@
* CONNECTING: indicates an outbound socket which is
* waiting to be writeable.
* WAIT_AUTH_1: indicates the socket is outbound and
- * has successfully connected, but has not
+ * has successfully connected, but has not
* yet sent and received SERVER strings.
* WAIT_AUTH_2: indicates that the socket is inbound
- * but has not yet sent and received
+ * but has not yet sent and received
* SERVER strings.
* CONNECTED: represents a fully authorized, fully
* connected server.
diff --git a/src/modules/m_spanningtree/utils.h b/src/modules/m_spanningtree/utils.h
index fd42c57e9..532223818 100644
--- a/src/modules/m_spanningtree/utils.h
+++ b/src/modules/m_spanningtree/utils.h
@@ -50,7 +50,7 @@ class SpanningTreeUtilities : public Cullable
CacheRefreshTimer RefreshTimer;
public:
- typedef std::set<TreeSocket*> TreeSocketSet;
+ typedef std::set<TreeSocket*> TreeSocketSet;
typedef std::map<TreeSocket*, std::pair<std::string, unsigned int> > TimeoutList;
/** Creator module
diff --git a/src/modules/m_sslinfo.cpp b/src/modules/m_sslinfo.cpp
index 5985ca95e..b83860166 100644
--- a/src/modules/m_sslinfo.cpp
+++ b/src/modules/m_sslinfo.cpp
@@ -239,7 +239,10 @@ class CommandSSLInfo : public SplitCommand
}
for (const auto& [u, _] : chan->GetUsers())
- HandleUserInternal(source, u, false);
+ {
+ if (!u->server->IsService())
+ HandleUserInternal(source, u, false);
+ }
return CmdResult::SUCCESS;
}
diff --git a/src/modules/m_svshold.cpp b/src/modules/m_svshold.cpp
index e7b7027db..61865bffb 100644
--- a/src/modules/m_svshold.cpp
+++ b/src/modules/m_svshold.cpp
@@ -81,8 +81,6 @@ class SVSHoldFactory : public XLineFactory
public:
SVSHoldFactory() : XLineFactory("SVSHOLD") { }
- /** Generate an SVSHOLD
- */
XLine* Generate(time_t set_time, unsigned long duration, const std::string& source, const std::string& reason, const std::string& xline_specific_mask) override
{
return new SVSHold(set_time, duration, source, reason, xline_specific_mask);
diff --git a/src/modules/m_websocket.cpp b/src/modules/m_websocket.cpp
index fc3319b4d..2fe41140e 100644
--- a/src/modules/m_websocket.cpp
+++ b/src/modules/m_websocket.cpp
@@ -25,7 +25,8 @@
#include "iohook.h"
#include "modules/hash.h"
-#include <utf8.h>
+#define UTF_CPP_CPLUSPLUS 199711L
+#include <unchecked.h>
static const char MagicGUID[] = "258EAFA5-E914-47DA-95CA-C5AB0DC85B11";
static const char whitespace[] = " \t\r\n";
@@ -339,6 +340,11 @@ class WebSocketHook : public IOHookMiddle
}
}
}
+ else
+ {
+ FailHandshake(sock, "HTTP/1.1 400 Bad Request\r\nConnection: close\r\n\r\n", "WebSocket: Received HTTP request that did not send the Origin header");
+ return -1;
+ }
if (!allowedorigin)
{
@@ -437,7 +443,7 @@ class WebSocketHook : public IOHookMiddle
{
// If we send messages as text then we need to ensure they are valid UTF-8.
std::string encoded;
- utf8::replace_invalid(message.begin(), message.end(), std::back_inserter(encoded));
+ utf8::unchecked::replace_invalid(message.begin(), message.end(), std::back_inserter(encoded));
mysendq.push_back(PrepareSendQElem(encoded.length(), OP_TEXT));
mysendq.push_back(encoded);
diff --git a/src/modules/m_xline_db.cpp b/src/modules/m_xline_db.cpp
index a49208422..d399081e4 100644
--- a/src/modules/m_xline_db.cpp
+++ b/src/modules/m_xline_db.cpp
@@ -49,9 +49,9 @@ class ModuleXLineDB
{
/* Load the configuration
* Note:
- * This is on purpose not changed on a rehash. It would be non-trivial to change the database on-the-fly.
- * Imagine a scenario where the new file already exists. Merging the current XLines with the existing database is likely a bad idea
- * ...and so is discarding all current in-memory XLines for the ones in the database.
+ * This is on purpose not changed on a rehash. It would be non-trivial to change the database on-the-fly.
+ * Imagine a scenario where the new file already exists. Merging the current XLines with the existing database is likely a bad idea
+ * ...and so is discarding all current in-memory XLines for the ones in the database.
*/
auto Conf = ServerInstance->Config->ConfValue("xlinedb");
xlinedbpath = ServerInstance->Config->Paths.PrependData(Conf->getString("filename", "xline.db", 1));
@@ -120,7 +120,7 @@ class ModuleXLineDB
* xline types may not have a conf tag, so let's just write them.
* In addition, let's use a file version, so we can maintain some
* semblance of backwards compatibility for reading on startup..
- * -- w00t
+ * -- w00t
*/
stream << "VERSION 1" << std::endl;
diff --git a/src/xline.cpp b/src/xline.cpp
index 51f5bb6c9..5ed1479eb 100644
--- a/src/xline.cpp
+++ b/src/xline.cpp
@@ -398,7 +398,7 @@ XLine* XLineManager::MatchesLine(const std::string &type, const std::string &pat
const time_t current = ServerInstance->Time();
- LookupIter safei;
+ LookupIter safei;
for (LookupIter i = x->second.begin(); i != x->second.end(); )
{