Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/master'
Browse files Browse the repository at this point in the history
  • Loading branch information
siniStar7 committed Dec 28, 2024
2 parents eacbd94 + db6d96d commit 10f65e9
Show file tree
Hide file tree
Showing 14 changed files with 612 additions and 30 deletions.
19 changes: 12 additions & 7 deletions 4/m_antiknocker.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
*/

/// $ModAuthor: Sadie Powell <[email protected]>
/// $ModConfig: <antiknock nickregex="(st|sn|cr|pl|pr|fr|fl|qu|br|gr|sh|sk|tr|kl|wr|bl|[bcdfgklmnprstvwz])([aeiou][aeiou][bcdfgklmnprstvwz])(ed|est|er|le|ly|y|ies|iest|ian|ion|est|ing|led|inger|[abcdfgklmnprstvwz])" docmd="yes" donick="yes" donotice="yes" doshun="yes" shunduration="15" shunreason="User was caught in an antiknock trap">
/// $ModConfig: <antiknock nickregex="(st|sn|cr|pl|pr|fr|fl|qu|br|gr|sh|sk|tr|kl|wr|bl|[bcdfgklmnprstvwz])([aeiou][aeiou][bcdfgklmnprstvwz])(ed|est|er|le|ly|y|ies|iest|ian|ion|est|ing|led|inger|[abcdfgklmnprstvwz])" docmd="yes" dokill="yes" donick="yes" donotice="yes" doshun="yes" shunduration="15" shunreason="User was caught in an antiknock trap">
/// $ModDesc: Attempts to block a common IRC spambot.
/// $ModDepends: core 4

Expand All @@ -33,6 +33,7 @@ class ModuleAntiKnocker final
{
public:
bool docmd;
bool dokill;
bool donick;
bool donotice;
bool doshun;
Expand All @@ -56,12 +57,15 @@ class ModuleAntiKnocker final
delete sh;
}

std::string message;
if (!user->IsFullyConnected())
message = "Connection timeout";
else
message = INSP_FORMAT("Ping timeout: {} seconds", user->GetClass()->pingtime);
ServerInstance->Users.QuitUser(user, message);
if (dokill)
{
std::string message;
if (!user->IsFullyConnected())
message = "Connection timeout";
else
message = INSP_FORMAT("Ping timeout: {} seconds", user->GetClass()->pingtime);
ServerInstance->Users.QuitUser(user, message);
}
}

ModuleAntiKnocker()
Expand All @@ -87,6 +91,7 @@ class ModuleAntiKnocker final
}

docmd = tag->getBool("docmd", true);
dokill = tag->getBool("dokill", true);
donick = tag->getBool("donick", true);
donotice = tag->getBool("donotice", true);
doshun = tag->getBool("doshun", true);
Expand Down
52 changes: 52 additions & 0 deletions 4/m_conn_banner.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
/*
* InspIRCd -- Internet Relay Chat Daemon
*
* Copyright (C) 2012 Attila Molnar <[email protected]>
*
* 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
* License as published by the Free Software Foundation, version 2.
*
* This program is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
* FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
* details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/

/// $ModAuthor: Attila Molnar <[email protected]>
/// $ModConfig: <connbanner text="Banner text goes here.">
/// $ModDepends: core 4
/// $ModDesc: Displays a static text to every connecting user before registration


#include "inspircd.h"

class ModuleConnBanner final
: public Module
{
private:
std::string text;

public:
ModuleConnBanner()
: Module(VF_NONE, "Displays a static text to every connecting user before registration")
{
}

void ReadConfig(ConfigStatus& status) override
{
const auto& tag = ServerInstance->Config->ConfValue("connbanner");
text = tag->getString("text");
}

void OnUserPostInit(LocalUser* user) override
{
if (!text.empty())
user->WriteNotice("*** " + text);
}
};

MODULE_INIT(ModuleConnBanner)
3 changes: 1 addition & 2 deletions 4/m_cve_2024_39844.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,7 @@
*/


/// $ModAuthor: Sadie Powell
/// $ModAuthorMail: [email protected]
/// $ModAuthor: Sadie Powell <[email protected]>
/// $ModDesc: Prevents clients from sending messages that trigger CVE-2024-39844.
/// $ModDepends: core 4

Expand Down
60 changes: 60 additions & 0 deletions 4/m_hideidle.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
/*
* InspIRCd -- Internet Relay Chat Daemon
*
* Copyright (C) 2010-2012 Attila Molnar <[email protected]>
*
* 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
* License as published by the Free Software Foundation, version 2.
*
* This program is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
* FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
* details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/

/// $ModAuthor: Attila Molnar <[email protected]>
/// $ModDepends: core 4
/// $ModDesc: Provides the +a usermode that hides idle and signon time in WHOIS from non-opers


#include "inspircd.h"
#include "modules/whois.h"

class ModuleHideIdle final
: public Module
, public Whois::LineEventListener
{
private:
SimpleUserMode hideidle;

public:
ModuleHideIdle()
: Module(VF_NONE, "Provides the +a usermode that hides idle and signon time in WHOIS from non-opers")
, Whois::LineEventListener(this)
, hideidle(this, "hideidle", 'a')
{
}

ModResult OnWhoisLine(Whois::Context& whois, Numeric::Numeric& numeric) override
{
if (numeric.GetNumeric() != RPL_WHOISIDLE)
return MOD_RES_PASSTHRU;

if (whois.GetSource() == whois.GetTarget())
return MOD_RES_PASSTHRU;

if (!whois.GetTarget()->IsModeSet(hideidle))
return MOD_RES_PASSTHRU;

if (!whois.GetSource()->HasPrivPermission("users/auspex"))
return MOD_RES_DENY;

return MOD_RES_PASSTHRU;
}
};

MODULE_INIT(ModuleHideIdle)
6 changes: 4 additions & 2 deletions 4/m_ircv3_extjwt.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,13 @@

/// $CompilerFlags: find_compiler_flags("RapidJSON")

/// $ModAuthor: Sadie Powell
/// $ModAuthorMail: [email protected]
/// $ModAuthor: Sadie Powell <[email protected]>
/// $ModDepends: core 4
/// $ModDesc: Provides the DRAFT extjwt IRCv3 extension.

/// $PackageInfo: require_system("debian~") rapidjson-dev
/// $PackageInfo: require_system("darwin") rapidjson

#include "inspircd.h"
#include "modules/account.h"
#include "modules/hash.h"
Expand Down
5 changes: 2 additions & 3 deletions 4/m_qrcode.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,9 @@
/// $LinkerFlags: find_linker_flags("libqrencode")

/// $PackageInfo: require_system("arch") qrencode pkgconf
/// $PackageInfo: require_system("centos") qrencode-devel pkgconfig
/// $PackageInfo: require_system("darwin") qrencode pkg-config
/// $PackageInfo: require_system("debian") libqrencode-dev pkg-config
/// $PackageInfo: require_system("ubuntu") libqrencode-dev pkg-config
/// $PackageInfo: require_system("debian~") libqrencode-dev pkg-config
/// $PackageInfo: require_system("rhel~") qrencode-devel pkgconfig

/// $ModAuthor: Sadie Powell <[email protected]>
/// $ModDesc: Provides support for QR code generation via the /QRCODE command.
Expand Down
5 changes: 2 additions & 3 deletions 4/m_regex_pcre.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,9 @@
/// $LinkerFlags: execute("pcre-config --libs" "PCRE_LDFLAGS" "-lpcre")

/// $PackageInfo: require_system("arch") pcre
/// $PackageInfo: require_system("centos") pcre-devel
/// $PackageInfo: require_system("darwin") pcre
/// $PackageInfo: require_system("debian") libpcre3-dev
/// $PackageInfo: require_system("ubuntu") libpcre3-dev
/// $PackageInfo: require_system("debian~") libpcre3-dev
/// $PackageInfo: require_system("rhel~") pcre-devel


#include "inspircd.h"
Expand Down
3 changes: 1 addition & 2 deletions 4/m_regex_tre.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,7 @@

/// $PackageInfo: require_system("arch") pkgconf tre
/// $PackageInfo: require_system("darwin") pkg-config tre
/// $PackageInfo: require_system("debian") libtre-dev pkg-config
/// $PackageInfo: require_system("ubuntu") libtre-dev pkg-config
/// $PackageInfo: require_system("debian~") libtre-dev pkg-config


#include "inspircd.h"
Expand Down
Loading

0 comments on commit 10f65e9

Please sign in to comment.