aboutsummaryrefslogtreecommitdiffstats
path: root/src/modules
diff options
context:
space:
mode:
authorGravatar Sadie Powell2020-11-20 12:49:02 +0000
committerGravatar Sadie Powell2020-11-20 15:45:17 +0000
commit54e0cade5c9ec904bbdc755d8031ed8e22e994f6 (patch)
tree312e579f280e7db2269c3fe754a6c4f423713c0e /src/modules
parentConvert IRCv3::Replies::Reply#Send[IfCap] to variadic functions. (diff)
parentRelease v3.8.1. (diff)
Merge tag 'v3.8.1' into master.
Diffstat (limited to 'src/modules')
-rw-r--r--src/modules/m_channelban.cpp6
-rw-r--r--src/modules/m_classban.cpp2
-rw-r--r--src/modules/m_cloaking.cpp2
-rw-r--r--src/modules/m_connectban.cpp10
-rw-r--r--src/modules/m_connflood.cpp4
-rw-r--r--src/modules/m_dnsbl.cpp11
-rw-r--r--src/modules/m_gecosban.cpp6
-rw-r--r--src/modules/m_geoclass.cpp2
-rw-r--r--src/modules/m_ident.cpp2
-rw-r--r--src/modules/m_noctcp.cpp2
-rw-r--r--src/modules/m_nopartmsg.cpp6
-rw-r--r--src/modules/m_password_hash.cpp4
-rw-r--r--src/modules/m_serverban.cpp6
-rw-r--r--src/modules/m_websocket.cpp6
14 files changed, 44 insertions, 25 deletions
diff --git a/src/modules/m_channelban.cpp b/src/modules/m_channelban.cpp
index 6b43756b2..8da1e20dc 100644
--- a/src/modules/m_channelban.cpp
+++ b/src/modules/m_channelban.cpp
@@ -1,9 +1,9 @@
/*
* InspIRCd -- Internet Relay Chat Daemon
*
- * Copyright (C) 2013 Sadie Powell <sadie@witchery.services>
- * Copyright (C) 2012, 2019 Robby <robby@chatbelgie.be>
+ * Copyright (C) 2013, 2020 Sadie Powell <sadie@witchery.services>
* Copyright (C) 2012, 2014-2016 Attila Molnar <attilamolnar@hush.com>
+ * Copyright (C) 2012 Robby <robby@chatbelgie.be>
* Copyright (C) 2010 Craig Edwards <brain@inspircd.org>
* Copyright (C) 2009 Uli Schlachter <psychon@inspircd.org>
* Copyright (C) 2009 Daniel De Graaf <danieldg@inspircd.org>
@@ -65,7 +65,7 @@ class ModuleBadChannelExtban
public:
ModuleBadChannelExtban()
- : Module(VF_VENDOR | VF_OPTCOMMON, "Adds the j extended ban which checks whether users are in a channel matching the specified glob pattern.")
+ : Module(VF_VENDOR | VF_OPTCOMMON, "Adds the j: extended ban which checks whether users are in a channel matching the specified glob pattern.")
, extban(this)
{
}
diff --git a/src/modules/m_classban.cpp b/src/modules/m_classban.cpp
index 4962a97b9..d3ff35a05 100644
--- a/src/modules/m_classban.cpp
+++ b/src/modules/m_classban.cpp
@@ -1,7 +1,7 @@
/*
* InspIRCd -- Internet Relay Chat Daemon
*
- * Copyright (C) 2019 Robby <robby@chatbelgie.be>
+ * Copyright (C) 2020 Sadie Powell <sadie@witchery.services>
* Copyright (C) 2016 Johanna A <johanna-a@users.noreply.github.com>
*
* This file is part of InspIRCd. InspIRCd is free software: you can
diff --git a/src/modules/m_cloaking.cpp b/src/modules/m_cloaking.cpp
index 4cf366ebd..61cfbf82a 100644
--- a/src/modules/m_cloaking.cpp
+++ b/src/modules/m_cloaking.cpp
@@ -490,7 +490,7 @@ class ModuleCloaking : public Module
void OnSetUserIP(LocalUser* user) override
{
// Connecting users are handled in OnUserConnect not here.
- if (user->registered != REG_ALL)
+ if (user->registered != REG_ALL || user->quitting)
return;
// Remove the cloaks and generate new ones.
diff --git a/src/modules/m_connectban.cpp b/src/modules/m_connectban.cpp
index f79eb0e06..70b66a786 100644
--- a/src/modules/m_connectban.cpp
+++ b/src/modules/m_connectban.cpp
@@ -3,7 +3,7 @@
*
* Copyright (C) 2019 Matt Schatz <genius3000@g3k.solutions>
* Copyright (C) 2014 Googolplexed <googol@googolplexed.net>
- * Copyright (C) 2013, 2017-2019 Sadie Powell <sadie@witchery.services>
+ * Copyright (C) 2013, 2017-2020 Sadie Powell <sadie@witchery.services>
* Copyright (C) 2012-2014 Attila Molnar <attilamolnar@hush.com>
* Copyright (C) 2012, 2019 Robby <robby@chatbelgie.be>
* Copyright (C) 2009-2010 Daniel De Graaf <danieldg@inspircd.org>
@@ -68,6 +68,12 @@ class ModuleConnectBan
{
}
+ void Prioritize() override
+ {
+ Module* corexline = ServerInstance->Modules.Find("core_xline");
+ ServerInstance->Modules.SetPriority(this, I_OnSetUserIP, PRIORITY_AFTER, corexline);
+ }
+
void ReadConfig(ConfigStatus& status) override
{
auto tag = ServerInstance->Config->ConfValue("connectban");
@@ -95,7 +101,7 @@ class ModuleConnectBan
void OnSetUserIP(LocalUser* u) override
{
- if (u->exempt)
+ if (u->exempt || u->quitting)
return;
irc::sockets::cidr_mask mask(u->client_sa, GetRange(u));
diff --git a/src/modules/m_connflood.cpp b/src/modules/m_connflood.cpp
index ba40150f7..3e730ac69 100644
--- a/src/modules/m_connflood.cpp
+++ b/src/modules/m_connflood.cpp
@@ -1,7 +1,7 @@
/*
* InspIRCd -- Internet Relay Chat Daemon
*
- * Copyright (C) 2013, 2018-2019 Sadie Powell <sadie@witchery.services>
+ * Copyright (C) 2013, 2018-2020 Sadie Powell <sadie@witchery.services>
* Copyright (C) 2012-2013 Attila Molnar <attilamolnar@hush.com>
* Copyright (C) 2012 Robby <robby@chatbelgie.be>
* Copyright (C) 2009 Daniel De Graaf <danieldg@inspircd.org>
@@ -39,7 +39,7 @@ class ModuleConnFlood : public Module
public:
ModuleConnFlood()
- : Module(VF_VENDOR, "Throttles IP addresses which make excessive connections to the server.")
+ : Module(VF_VENDOR, "Throttles excessive connections to the server.")
{
}
diff --git a/src/modules/m_dnsbl.cpp b/src/modules/m_dnsbl.cpp
index ca8c6f10b..376ada344 100644
--- a/src/modules/m_dnsbl.cpp
+++ b/src/modules/m_dnsbl.cpp
@@ -280,6 +280,12 @@ class ModuleDNSBL : public Module, public Stats::EventListener
ServerInstance->SNO.EnableSnomask('d', "DNSBL");
}
+ void Prioritize() override
+ {
+ Module* corexline = ServerInstance->Modules.Find("core_xline");
+ ServerInstance->Modules.SetPriority(this, I_OnSetUserIP, PRIORITY_AFTER, corexline);
+ }
+
void ReadConfig(ConfigStatus& status) override
{
DNSBLConfList newentries;
@@ -343,7 +349,7 @@ class ModuleDNSBL : public Module, public Stats::EventListener
void OnSetUserIP(LocalUser* user) override
{
- if ((user->exempt) || !DNS)
+ if (user->exempt || user->quitting || !DNS)
return;
// Clients can't be in a DNSBL if they aren't connected via IPv4 or IPv6.
@@ -356,7 +362,10 @@ class ModuleDNSBL : public Module, public Stats::EventListener
return;
}
else
+ {
ServerInstance->Logs.Log(MODNAME, LOG_DEBUG, "User has no connect class in OnSetUserIP");
+ return;
+ }
std::string reversedip;
if (user->client_sa.family() == AF_INET)
diff --git a/src/modules/m_gecosban.cpp b/src/modules/m_gecosban.cpp
index 75ccb770c..edcad7b9c 100644
--- a/src/modules/m_gecosban.cpp
+++ b/src/modules/m_gecosban.cpp
@@ -2,7 +2,7 @@
* InspIRCd -- Internet Relay Chat Daemon
*
* Copyright (C) 2015 Renegade334 <contact.caaeed4f@renegade334.me.uk>
- * Copyright (C) 2013, 2018 Sadie Powell <sadie@witchery.services>
+ * Copyright (C) 2013, 2018, 2020 Sadie Powell <sadie@witchery.services>
* Copyright (C) 2012 Robby <robby@chatbelgie.be>
* Copyright (C) 2010 Craig Edwards <brain@inspircd.org>
* Copyright (C) 2009 Uli Schlachter <psychon@inspircd.org>
@@ -72,10 +72,10 @@ class ModuleGecosBan
private:
RealMaskExtBan maskextban;
RealNameExtBan realextban;
-
+
public:
ModuleGecosBan()
- : Module(VF_VENDOR | VF_OPTCOMMON, "Adds the r extended ban which checks whether users have a real name (gecos) matching the specified glob pattern.")
+ : Module(VF_VENDOR | VF_OPTCOMMON, "Adds the r: extended ban which checks whether users have a real name (gecos) matching the specified glob pattern.")
, maskextban(this)
, realextban(this)
{
diff --git a/src/modules/m_geoclass.cpp b/src/modules/m_geoclass.cpp
index 8076e3a09..bd08712e2 100644
--- a/src/modules/m_geoclass.cpp
+++ b/src/modules/m_geoclass.cpp
@@ -1,7 +1,7 @@
/*
* InspIRCd -- Internet Relay Chat Daemon
*
- * Copyright (C) 2019 Sadie Powell <sadie@witchery.services>
+ * Copyright (C) 2019-2020 Sadie Powell <sadie@witchery.services>
*
* This file is part of InspIRCd. InspIRCd is free software: you can
* redistribute it and/or modify it under the terms of the GNU General Public
diff --git a/src/modules/m_ident.cpp b/src/modules/m_ident.cpp
index 16dcc0145..54f29ad98 100644
--- a/src/modules/m_ident.cpp
+++ b/src/modules/m_ident.cpp
@@ -327,7 +327,7 @@ class ModuleIdent : public Module
return;
// We don't want to look this up once the user has connected.
- if (user->registered == REG_ALL)
+ if (user->registered == REG_ALL || user->quitting)
return;
std::shared_ptr<ConfigTag> tag = user->MyClass->config;
diff --git a/src/modules/m_noctcp.cpp b/src/modules/m_noctcp.cpp
index 8bfeade4b..8c6a715bf 100644
--- a/src/modules/m_noctcp.cpp
+++ b/src/modules/m_noctcp.cpp
@@ -40,7 +40,7 @@ class ModuleNoCTCP : public Module
public:
ModuleNoCTCP()
- : Module(VF_VENDOR, "Adds channel mode C (noctcp) which allows channels to block messages which contain CTCPs.")
+ : Module(VF_VENDOR, "Adds channel mode C (noctcp) which allows channels to block messages which contain CTCPs and user mode T (u_noctcp) which allows users to block private messages that contain CTCPs.")
, exemptionprov(this)
, extban(this, "noctcp", 'C')
, nc(this, "noctcp", 'C')
diff --git a/src/modules/m_nopartmsg.cpp b/src/modules/m_nopartmsg.cpp
index a624daced..df835e9cf 100644
--- a/src/modules/m_nopartmsg.cpp
+++ b/src/modules/m_nopartmsg.cpp
@@ -1,8 +1,8 @@
/*
* InspIRCd -- Internet Relay Chat Daemon
*
- * Copyright (C) 2013 Sadie Powell <sadie@witchery.services>
- * Copyright (C) 2012, 2019 Robby <robby@chatbelgie.be>
+ * Copyright (C) 2013, 2020 Sadie Powell <sadie@witchery.services>
+ * Copyright (C) 2012 Robby <robby@chatbelgie.be>
* Copyright (C) 2012 Attila Molnar <attilamolnar@hush.com>
* Copyright (C) 2010 Craig Edwards <brain@inspircd.org>
* Copyright (C) 2009-2010 Daniel De Graaf <danieldg@inspircd.org>
@@ -33,7 +33,7 @@ class ModulePartMsgBan : public Module
public:
ModulePartMsgBan()
- : Module(VF_VENDOR | VF_OPTCOMMON, "Adds the p extended ban which blocks the part message of matching users.")
+ : Module(VF_VENDOR | VF_OPTCOMMON, "Adds the p: extended ban which blocks the part message of matching users.")
, extban(this, "partmsg", 'p')
{
}
diff --git a/src/modules/m_password_hash.cpp b/src/modules/m_password_hash.cpp
index aaa069fa8..9833809b3 100644
--- a/src/modules/m_password_hash.cpp
+++ b/src/modules/m_password_hash.cpp
@@ -2,7 +2,7 @@
* InspIRCd -- Internet Relay Chat Daemon
*
* Copyright (C) 2014 Daniel Vassdal <shutter@canternet.org>
- * Copyright (C) 2013, 2017-2018 Sadie Powell <sadie@witchery.services>
+ * Copyright (C) 2013, 2017-2018, 2020 Sadie Powell <sadie@witchery.services>
* Copyright (C) 2012, 2019 Robby <robby@chatbelgie.be>
* Copyright (C) 2012, 2014-2015 Attila Molnar <attilamolnar@hush.com>
* Copyright (C) 2009-2010 Daniel De Graaf <danieldg@inspircd.org>
@@ -84,7 +84,7 @@ class ModulePasswordHash : public Module
public:
ModulePasswordHash()
- : Module(VF_VENDOR, "Adds the /MKPASSWD command which allows the generation of hashed passwords for use in the server configuration.")
+ : Module(VF_VENDOR, "Allows passwords to be hashed and adds the /MKPASSWD command which allows the generation of hashed passwords for use in the server configuration.")
, cmd(this)
{
}
diff --git a/src/modules/m_serverban.cpp b/src/modules/m_serverban.cpp
index 044925a1d..97d4b3962 100644
--- a/src/modules/m_serverban.cpp
+++ b/src/modules/m_serverban.cpp
@@ -1,9 +1,9 @@
/*
* InspIRCd -- Internet Relay Chat Daemon
*
- * Copyright (C) 2013 Sadie Powell <sadie@witchery.services>
- * Copyright (C) 2012, 2019 Robby <robby@chatbelgie.be>
+ * Copyright (C) 2013, 2020 Sadie Powell <sadie@witchery.services>
* Copyright (C) 2012, 2014 Attila Molnar <attilamolnar@hush.com>
+ * Copyright (C) 2012 Robby <robby@chatbelgie.be>
* Copyright (C) 2010 Craig Edwards <brain@inspircd.org>
* Copyright (C) 2009 Uli Schlachter <psychon@inspircd.org>
* Copyright (C) 2009 Daniel De Graaf <danieldg@inspircd.org>
@@ -49,7 +49,7 @@ class ModuleServerBan
public:
ModuleServerBan()
- : Module(VF_VENDOR | VF_OPTCOMMON, "Adds the s extended ban which check whether users are on a server matching the specified glob pattern.")
+ : Module(VF_VENDOR | VF_OPTCOMMON, "Adds the s: extended ban which check whether users are on a server matching the specified glob pattern.")
, extban(this)
{
}
diff --git a/src/modules/m_websocket.cpp b/src/modules/m_websocket.cpp
index bfbd8e871..f0608a80d 100644
--- a/src/modules/m_websocket.cpp
+++ b/src/modules/m_websocket.cpp
@@ -2,7 +2,7 @@
* InspIRCd -- Internet Relay Chat Daemon
*
* Copyright (C) 2019 iwalkalone <iwalkalone69@gmail.com>
- * Copyright (C) 2017-2019 Sadie Powell <sadie@witchery.services>
+ * Copyright (C) 2017-2020 Sadie Powell <sadie@witchery.services>
* Copyright (C) 2016-2017 Attila Molnar <attilamolnar@hush.com>
*
* This file is part of InspIRCd. InspIRCd is free software: you can
@@ -370,6 +370,10 @@ class WebSocketHook : public IOHookMiddle
// Give the user their real IP address.
if (realsa != luser->client_sa)
luser->SetClientIP(realsa);
+
+ // Error if changing their IP gets them banned.
+ if (luser->quitting)
+ return -1;
break;
}
}