From 116244f190e8146395d40fb5a43af6b9bb1f6d1f Mon Sep 17 00:00:00 2001 From: Sadie Powell Date: Tue, 10 Nov 2020 17:48:49 +0000 Subject: Prioritise connectban and dnsbl after core_xline. --- src/modules/m_connectban.cpp | 6 ++++++ src/modules/m_dnsbl.cpp | 6 ++++++ 2 files changed, 12 insertions(+) (limited to 'src/modules') diff --git a/src/modules/m_connectban.cpp b/src/modules/m_connectban.cpp index bb3fcbc46..09390bb07 100644 --- a/src/modules/m_connectban.cpp +++ b/src/modules/m_connectban.cpp @@ -67,6 +67,12 @@ class ModuleConnectBan { } + void Prioritize() CXX11_OVERRIDE + { + Module* corexline = ServerInstance->Modules->Find("core_xline"); + ServerInstance->Modules->SetPriority(this, I_OnSetUserIP, PRIORITY_AFTER, corexline); + } + Version GetVersion() CXX11_OVERRIDE { return Version("Z-lines IP addresses which make excessive connections to the server.", VF_VENDOR); diff --git a/src/modules/m_dnsbl.cpp b/src/modules/m_dnsbl.cpp index 6265ca85a..4873e2322 100644 --- a/src/modules/m_dnsbl.cpp +++ b/src/modules/m_dnsbl.cpp @@ -279,6 +279,12 @@ class ModuleDNSBL : public Module, public Stats::EventListener ServerInstance->SNO->EnableSnomask('d', "DNSBL"); } + void Prioritize() CXX11_OVERRIDE + { + Module* corexline = ServerInstance->Modules->Find("core_xline"); + ServerInstance->Modules->SetPriority(this, I_OnSetUserIP, PRIORITY_AFTER, corexline); + } + Version GetVersion() CXX11_OVERRIDE { return Version("Allows the server administrator to check the IP address of connecting users against a DNSBL.", VF_VENDOR); -- cgit v1.3.1-10-gc9f91 From d4685e02b55229e0ca5068b839c87b5a80180f33 Mon Sep 17 00:00:00 2001 From: Sadie Powell Date: Thu, 19 Nov 2020 19:21:10 +0000 Subject: Avoid doing "IP changed" event stuff on quitting users. --- src/coremods/core_hostname_lookup.cpp | 2 +- src/modules/m_cloaking.cpp | 2 +- src/modules/m_connectban.cpp | 2 +- src/modules/m_dnsbl.cpp | 5 ++++- src/modules/m_ident.cpp | 2 +- 5 files changed, 8 insertions(+), 5 deletions(-) (limited to 'src/modules') diff --git a/src/coremods/core_hostname_lookup.cpp b/src/coremods/core_hostname_lookup.cpp index 89c361555..db9063ff6 100644 --- a/src/coremods/core_hostname_lookup.cpp +++ b/src/coremods/core_hostname_lookup.cpp @@ -177,7 +177,7 @@ class ModuleHostnameLookup : public Module { // If core_dns is not loaded or hostname resolution is disabled for the user's // connect class then the logic in this function does not apply. - if (!DNS || !user->MyClass->resolvehostnames) + if (!DNS || user->quitting || !user->MyClass->resolvehostnames) return; // Clients can't have a DNS hostname if they aren't connected via IPv4 or IPv6. diff --git a/src/modules/m_cloaking.cpp b/src/modules/m_cloaking.cpp index 3f1774e7b..69f376d2c 100644 --- a/src/modules/m_cloaking.cpp +++ b/src/modules/m_cloaking.cpp @@ -493,7 +493,7 @@ class ModuleCloaking : public Module void OnSetUserIP(LocalUser* user) CXX11_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 09390bb07..04a73ab82 100644 --- a/src/modules/m_connectban.cpp +++ b/src/modules/m_connectban.cpp @@ -105,7 +105,7 @@ class ModuleConnectBan void OnSetUserIP(LocalUser* u) CXX11_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_dnsbl.cpp b/src/modules/m_dnsbl.cpp index 4873e2322..37819c05c 100644 --- a/src/modules/m_dnsbl.cpp +++ b/src/modules/m_dnsbl.cpp @@ -357,7 +357,7 @@ class ModuleDNSBL : public Module, public Stats::EventListener void OnSetUserIP(LocalUser* user) CXX11_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. @@ -370,7 +370,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_ident.cpp b/src/modules/m_ident.cpp index 73dc64cf0..a0d5443d6 100644 --- a/src/modules/m_ident.cpp +++ b/src/modules/m_ident.cpp @@ -331,7 +331,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; ConfigTag* tag = user->MyClass->config; -- cgit v1.3.1-10-gc9f91 From 061a2e1aed3727b785976ea167cf2084d3e8f0f9 Mon Sep 17 00:00:00 2001 From: Sadie Powell Date: Thu, 19 Nov 2020 20:29:54 +0000 Subject: Fail websocket connections if changing the user's IP errors. --- src/modules/m_websocket.cpp | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'src/modules') diff --git a/src/modules/m_websocket.cpp b/src/modules/m_websocket.cpp index e2b0ee30a..1cba6bca6 100644 --- a/src/modules/m_websocket.cpp +++ b/src/modules/m_websocket.cpp @@ -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; } } -- cgit v1.3.1-10-gc9f91 From ad797e3a77c69791c02db6d238817d3e23821dec Mon Sep 17 00:00:00 2001 From: Sadie Powell Date: Thu, 19 Nov 2020 21:19:19 +0000 Subject: Update the module descriptions. --- src/modules/m_channelban.cpp | 2 +- src/modules/m_classban.cpp | 2 +- src/modules/m_connflood.cpp | 2 +- src/modules/m_gecosban.cpp | 2 +- src/modules/m_noctcp.cpp | 2 +- src/modules/m_nopartmsg.cpp | 2 +- src/modules/m_password_hash.cpp | 2 +- src/modules/m_serverban.cpp | 2 +- 8 files changed, 8 insertions(+), 8 deletions(-) (limited to 'src/modules') diff --git a/src/modules/m_channelban.cpp b/src/modules/m_channelban.cpp index 08b994566..f1679bd5d 100644 --- a/src/modules/m_channelban.cpp +++ b/src/modules/m_channelban.cpp @@ -30,7 +30,7 @@ class ModuleBadChannelExtban : public Module public: Version GetVersion() CXX11_OVERRIDE { - return Version("Adds the j extended ban which checks whether users are in a channel matching the specified glob pattern.", VF_OPTCOMMON|VF_VENDOR); + return Version("Adds the j: extended ban which checks whether users are in a channel matching the specified glob pattern.", VF_OPTCOMMON|VF_VENDOR); } ModResult OnCheckBan(User *user, Channel *c, const std::string& mask) CXX11_OVERRIDE diff --git a/src/modules/m_classban.cpp b/src/modules/m_classban.cpp index 824119c5e..f6967f51f 100644 --- a/src/modules/m_classban.cpp +++ b/src/modules/m_classban.cpp @@ -41,7 +41,7 @@ class ModuleClassBan : public Module Version GetVersion() CXX11_OVERRIDE { - return Version("Adds the n extended ban which check whether users are in a connect class matching the specified glob pattern.", VF_VENDOR | VF_OPTCOMMON); + return Version("Adds the n: extended ban which check whether users are in a connect class matching the specified glob pattern.", VF_VENDOR | VF_OPTCOMMON); } }; diff --git a/src/modules/m_connflood.cpp b/src/modules/m_connflood.cpp index 55e50a8f1..bd1eea8d0 100644 --- a/src/modules/m_connflood.cpp +++ b/src/modules/m_connflood.cpp @@ -44,7 +44,7 @@ public: Version GetVersion() CXX11_OVERRIDE { - return Version("Throttles IP addresses which make excessive connections to the server.", VF_VENDOR); + return Version("Throttles excessive connections to the server.", VF_VENDOR); } void ReadConfig(ConfigStatus& status) CXX11_OVERRIDE diff --git a/src/modules/m_gecosban.cpp b/src/modules/m_gecosban.cpp index 2bbc4ad61..db62663b1 100644 --- a/src/modules/m_gecosban.cpp +++ b/src/modules/m_gecosban.cpp @@ -30,7 +30,7 @@ class ModuleGecosBan : public Module public: Version GetVersion() CXX11_OVERRIDE { - return Version("Adds the r extended ban which checks whether users have a real name (gecos) matching the specified glob pattern.", VF_OPTCOMMON|VF_VENDOR); + return Version("Adds the r: extended ban which checks whether users have a real name (gecos) matching the specified glob pattern.", VF_OPTCOMMON|VF_VENDOR); } ModResult OnCheckBan(User *user, Channel *c, const std::string& mask) CXX11_OVERRIDE diff --git a/src/modules/m_noctcp.cpp b/src/modules/m_noctcp.cpp index 37e784166..2a61478ab 100644 --- a/src/modules/m_noctcp.cpp +++ b/src/modules/m_noctcp.cpp @@ -56,7 +56,7 @@ class ModuleNoCTCP : public Module Version GetVersion() CXX11_OVERRIDE { - return Version("Adds channel mode C (noctcp) which allows channels to block messages which contain CTCPs.", VF_VENDOR); + return Version("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.", VF_VENDOR); } ModResult OnUserPreMessage(User* user, const MessageTarget& target, MessageDetails& details) CXX11_OVERRIDE diff --git a/src/modules/m_nopartmsg.cpp b/src/modules/m_nopartmsg.cpp index 8bfba0cfe..f148b4549 100644 --- a/src/modules/m_nopartmsg.cpp +++ b/src/modules/m_nopartmsg.cpp @@ -30,7 +30,7 @@ class ModulePartMsgBan : public Module public: Version GetVersion() CXX11_OVERRIDE { - return Version("Adds the p extended ban which blocks the part message of matching users.", VF_OPTCOMMON|VF_VENDOR); + return Version("Adds the p: extended ban which blocks the part message of matching users.", VF_OPTCOMMON|VF_VENDOR); } void OnUserPart(Membership* memb, std::string &partmessage, CUList& excepts) CXX11_OVERRIDE diff --git a/src/modules/m_password_hash.cpp b/src/modules/m_password_hash.cpp index 2df3300a5..be892e0c6 100644 --- a/src/modules/m_password_hash.cpp +++ b/src/modules/m_password_hash.cpp @@ -134,7 +134,7 @@ class ModulePasswordHash : public Module Version GetVersion() CXX11_OVERRIDE { - return Version("Adds the /MKPASSWD command which allows the generation of hashed passwords for use in the server configuration.", VF_VENDOR); + return Version("Allows passwords to be hashed and adds the /MKPASSWD command which allows the generation of hashed passwords for use in the server configuration.", VF_VENDOR); } }; diff --git a/src/modules/m_serverban.cpp b/src/modules/m_serverban.cpp index d821144ec..d80d789f7 100644 --- a/src/modules/m_serverban.cpp +++ b/src/modules/m_serverban.cpp @@ -30,7 +30,7 @@ class ModuleServerBan : public Module public: Version GetVersion() CXX11_OVERRIDE { - return Version("Adds the s extended ban which check whether users are on a server matching the specified glob pattern.", VF_OPTCOMMON|VF_VENDOR); + return Version("Adds the s: extended ban which check whether users are on a server matching the specified glob pattern.", VF_OPTCOMMON|VF_VENDOR); } ModResult OnCheckBan(User *user, Channel *c, const std::string& mask) CXX11_OVERRIDE -- cgit v1.3.1-10-gc9f91 From f3f2388a81b6463e1229fa5bf2b8c427440bf406 Mon Sep 17 00:00:00 2001 From: InspIRCd Robot Date: Thu, 19 Nov 2020 22:09:17 +0000 Subject: Update copyright headers. --- src/coremods/core_hostname_lookup.cpp | 2 +- src/modules/m_channelban.cpp | 4 ++-- src/modules/m_classban.cpp | 2 +- src/modules/m_connectban.cpp | 2 +- src/modules/m_connflood.cpp | 2 +- src/modules/m_gecosban.cpp | 2 +- src/modules/m_geoclass.cpp | 2 +- src/modules/m_nopartmsg.cpp | 4 ++-- src/modules/m_password_hash.cpp | 2 +- src/modules/m_serverban.cpp | 4 ++-- src/modules/m_websocket.cpp | 2 +- 11 files changed, 14 insertions(+), 14 deletions(-) (limited to 'src/modules') diff --git a/src/coremods/core_hostname_lookup.cpp b/src/coremods/core_hostname_lookup.cpp index db9063ff6..91d817765 100644 --- a/src/coremods/core_hostname_lookup.cpp +++ b/src/coremods/core_hostname_lookup.cpp @@ -3,7 +3,7 @@ * * Copyright (C) 2020 Matt Schatz * Copyright (C) 2013-2015 Attila Molnar - * Copyright (C) 2013, 2017-2019 Sadie Powell + * Copyright (C) 2013, 2017-2020 Sadie Powell * Copyright (C) 2013, 2016 Adam * * This file is part of InspIRCd. InspIRCd is free software: you can diff --git a/src/modules/m_channelban.cpp b/src/modules/m_channelban.cpp index f1679bd5d..ea31e90dc 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 - * Copyright (C) 2012, 2019 Robby + * Copyright (C) 2013, 2020 Sadie Powell * Copyright (C) 2012, 2014-2016 Attila Molnar + * Copyright (C) 2012 Robby * Copyright (C) 2010 Craig Edwards * Copyright (C) 2009 Uli Schlachter * Copyright (C) 2009 Daniel De Graaf diff --git a/src/modules/m_classban.cpp b/src/modules/m_classban.cpp index f6967f51f..89cbf0efe 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 + * Copyright (C) 2020 Sadie Powell * Copyright (C) 2016 Johanna A * * This file is part of InspIRCd. InspIRCd is free software: you can diff --git a/src/modules/m_connectban.cpp b/src/modules/m_connectban.cpp index 04a73ab82..81b0fcfa7 100644 --- a/src/modules/m_connectban.cpp +++ b/src/modules/m_connectban.cpp @@ -3,7 +3,7 @@ * * Copyright (C) 2019 Matt Schatz * Copyright (C) 2014 Googolplexed - * Copyright (C) 2013, 2017-2019 Sadie Powell + * Copyright (C) 2013, 2017-2020 Sadie Powell * Copyright (C) 2012-2014 Attila Molnar * Copyright (C) 2012, 2019 Robby * Copyright (C) 2009-2010 Daniel De Graaf diff --git a/src/modules/m_connflood.cpp b/src/modules/m_connflood.cpp index bd1eea8d0..809055a5a 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 + * Copyright (C) 2013, 2018-2020 Sadie Powell * Copyright (C) 2012-2013 Attila Molnar * Copyright (C) 2012 Robby * Copyright (C) 2009 Daniel De Graaf diff --git a/src/modules/m_gecosban.cpp b/src/modules/m_gecosban.cpp index db62663b1..896eaaacf 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 - * Copyright (C) 2013, 2018 Sadie Powell + * Copyright (C) 2013, 2018, 2020 Sadie Powell * Copyright (C) 2012 Robby * Copyright (C) 2010 Craig Edwards * Copyright (C) 2009 Uli Schlachter diff --git a/src/modules/m_geoclass.cpp b/src/modules/m_geoclass.cpp index 8289c9a60..44e0de209 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 + * Copyright (C) 2019-2020 Sadie Powell * * 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_nopartmsg.cpp b/src/modules/m_nopartmsg.cpp index f148b4549..bd738a2da 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 - * Copyright (C) 2012, 2019 Robby + * Copyright (C) 2013, 2020 Sadie Powell + * Copyright (C) 2012 Robby * Copyright (C) 2012 Attila Molnar * Copyright (C) 2010 Craig Edwards * Copyright (C) 2009-2010 Daniel De Graaf diff --git a/src/modules/m_password_hash.cpp b/src/modules/m_password_hash.cpp index be892e0c6..814c33512 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 - * Copyright (C) 2013, 2017-2018 Sadie Powell + * Copyright (C) 2013, 2017-2018, 2020 Sadie Powell * Copyright (C) 2012, 2019 Robby * Copyright (C) 2012, 2014-2015 Attila Molnar * Copyright (C) 2009-2010 Daniel De Graaf diff --git a/src/modules/m_serverban.cpp b/src/modules/m_serverban.cpp index d80d789f7..405703f84 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 - * Copyright (C) 2012, 2019 Robby + * Copyright (C) 2013, 2020 Sadie Powell * Copyright (C) 2012, 2014 Attila Molnar + * Copyright (C) 2012 Robby * Copyright (C) 2010 Craig Edwards * Copyright (C) 2009 Uli Schlachter * Copyright (C) 2009 Daniel De Graaf diff --git a/src/modules/m_websocket.cpp b/src/modules/m_websocket.cpp index 1cba6bca6..05a9ce2e8 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 - * Copyright (C) 2017-2019 Sadie Powell + * Copyright (C) 2017-2020 Sadie Powell * Copyright (C) 2016-2017 Attila Molnar * * This file is part of InspIRCd. InspIRCd is free software: you can -- cgit v1.3.1-10-gc9f91