Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/insp3' into insp3
Browse files Browse the repository at this point in the history
  • Loading branch information
siniStar7 committed Nov 16, 2023
2 parents 58e91f8 + 95d72a2 commit 56d1fe4
Show file tree
Hide file tree
Showing 20 changed files with 287 additions and 123 deletions.
5 changes: 3 additions & 2 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ Tick the boxes for the checks you have made.

I have ensured that:

- [ ] This pull request does not introduce any incompatible API changes.
- [ ] If ABI changes have been made I have incremented MODULE_ABI in `moduledefs.h`.
- [ ] The code I am submitting is my own work and/or I have permission from the author to share it.
- [ ] I have documented any features added by this pull request.
- [ ] This pull request does not introduce any incompatible API changes (stable branches only).
- [ ] If ABI changes have been made I have incremented MODULE_ABI in `moduledefs.h` (stable branches only).
2 changes: 1 addition & 1 deletion .github/workflows/ci-alpine.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ jobs:
CXXFLAGS: -std=${{ matrix.standard }} -Wno-error=variadic-macros
TEST_BUILD_MODULES: argon2 geo_maxmind ldap mysql pgsql regex_pcre regex_pcre2 regex_posix regex_re2 regex_stdlib regex_tre sqlite3 ssl_gnutls ssl_mbedtls ssl_openssl sslrehashsignal
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4

- name: Install dependencies
run: |
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/ci-irctest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,10 @@ jobs:
runs-on: ubuntu-22.04
steps:
- name: Checkout repository
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Checkout irctest
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
path: irctest
ref: 59b2cd729b7785c3768e2ed8c4baa89472b45391
Expand Down Expand Up @@ -70,7 +70,7 @@ jobs:
find -name 'artifacts-inspircd.tar.gz' -exec tar -xzf '{}' \;
- name: Checkout irctest
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
path: irctest
ref: 59b2cd729b7785c3768e2ed8c4baa89472b45391
Expand All @@ -86,7 +86,7 @@ jobs:
# Can't apt-get install Anope if we want Insp4 support
- name: Checkout Anope
if: matrix.services == 'anope'
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
path: anope
ref: 2.0.9
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/ci-linux.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ jobs:
CXXFLAGS: -std=${{ matrix.standard }}
TEST_BUILD_MODULES: argon2 geo_maxmind ldap mysql pgsql regex_pcre regex_pcre2 regex_posix regex_re2 regex_stdlib regex_tre sqlite3 ssl_gnutls ssl_mbedtls ssl_openssl sslrehashsignal
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4

- name: Install dependencies
run: |
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/ci-macos.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:
HOMEBREW_NO_INSTALLED_DEPENDENTS_CHECK: 1
TEST_BUILD_MODULES: argon2 geo_maxmind ldap mysql pgsql regex_pcre regex_pcre2 regex_posix regex_re2 regex_stdlib regex_tre sqlite3 ssl_gnutls ssl_mbedtls ssl_openssl sslrehashsignal
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4

- name: Install dependencies
run: |
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/ci-windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ jobs:
if: "!contains(github.event.head_commit.message, '[skip windows ci]')"
runs-on: windows-2019
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4

- name: Setup MSBuild
uses: microsoft/[email protected]
Expand All @@ -19,7 +19,7 @@ jobs:
- name: Setup Conan
uses: turtlebrowser/[email protected]
with:
version: 1.60.1
version: 1.60.2

- name: Install libraries
working-directory: ${{ github.workspace }}/win/build
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/misspell-fixer.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ jobs:
env:
REF_BRANCH: ${{ github.ref }}
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name : Set a couple env variables
run: |
echo "DATE=$(date +'%Y-%m-%d')" >> $GITHUB_ENV
Expand Down
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,9 @@
/GNUmakefile
/build
/core
/core.*
/vgcore
/vgcore.*
/docs/doxygen
/run

Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ If you encounter any bugs then [please file an issue](https://github.com/inspirc

Most InspIRCd users running a UNIX-like system build from source. A guide about how to do this is available on [the InspIRCd docs site](https://docs.inspircd.org/3/installation/source).

Building from source on Windows is generally not recommended but [a guide is available](https://github.com/inspircd/inspircd/blob/master/win/README.txt) if you wish to do this.
Building from source on Windows is generally not recommended but [a guide is available](https://docs.inspircd.org/3/installation/windows-source/) if you wish to do this.

If you are running on CentOS 7, Debian 11/12, Rocky Linux 8/9, Ubuntu 18.04/20.04/22.04, or Windows 8+ binary packages are available from [the downloads page](https://github.com/inspircd/inspircd/releases/latest).

Expand Down
8 changes: 4 additions & 4 deletions docs/conf/modules.conf.example
Original file line number Diff line number Diff line change
Expand Up @@ -106,10 +106,10 @@
# command "foo bar baz qux quz" then $3- will hold #
# "baz qux quz" and $2 will contain "bar". You may #
# also use the special variables: $nick, $ident, #
# $host and $vhost, and you may separate multiple #
# commands with a newline (which can be written in #
# the file literally, or encoded as &nl; or \n #
# depending on the config format setting). #
# $address, $host and $vhost, and you may separate #
# multiple commands with a newline (which can be #
# written in the file literally or encoded as &nl; #
# or \n depending on the config format setting). #
# #
# requires - If you provide a value for 'requires' this means #
# the given nickname MUST be online for the alias #
Expand Down
5 changes: 5 additions & 0 deletions docs/conf/services/generic.conf.example
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,11 @@
# Identifies to a services account.
<alias text="ID" format="*" replace="SQUERY $requirement :IDENTIFY $2-" requires="NickServ" uline="yes">
<alias text="IDENTIFY" format="*" replace="SQUERY $requirement :IDENTIFY $2-" requires="NickServ" uline="yes">
<alias text="LOGIN" format="*" replace="SQUERY $requirement :IDENTIFY $2-" requires="NickServ" uline="yes">

# /LOGOUT
# Logs out of a services account.
<alias text="LOGOUT" format="*" replace="SQUERY $requirement :LOGOUT" requires="NickServ" uline="yes">

# Prevent clients from using the nicknames of services pseudoclients.
<badnick nick="BotServ" reason="Reserved for a network service">
Expand Down
16 changes: 16 additions & 0 deletions include/clientprotocol.h
Original file line number Diff line number Diff line change
Expand Up @@ -92,8 +92,10 @@ class CoreExport ClientProtocol::TagSelection

class CoreExport ClientProtocol::MessageSource
{
protected:
User* sourceuser;
const std::string* sourcestr;
bool sourceowned:1;

public:
/** Constructor, sets the source to be the full host of a user or sets it to be nothing.
Expand All @@ -102,10 +104,17 @@ class CoreExport ClientProtocol::MessageSource
* Optional, defaults to NULL.
*/
MessageSource(User* Sourceuser = NULL)
: sourceowned(false)
{
SetSourceUser(Sourceuser);
}

~MessageSource()
{
if (sourceowned && sourcestr)
delete sourcestr;
}

/** Constructor, sets the source to the supplied string and optionally sets the source user.
* @param Sourcestr String to use as message source for serialization purposes. Must remain valid
* as long as this object is alive.
Expand All @@ -114,6 +123,7 @@ class CoreExport ClientProtocol::MessageSource
* Useful when the source string is synthesized but it is still related to a User.
*/
MessageSource(const std::string& Sourcestr, User* Sourceuser = NULL)
: sourceowned(false)
{
SetSource(Sourcestr, Sourceuser);
}
Expand Down Expand Up @@ -451,6 +461,12 @@ class CoreExport ClientProtocol::Message : public ClientProtocol::MessageSource
if (!curr.IsOwned())
ReplaceParam(j, curr);
}

if (GetSource())
{
sourcestr = new std::string(*GetSource());
sourceowned = true;
}
}

void SetSideEffect(bool Sideeffect) { sideeffect = Sideeffect; }
Expand Down
10 changes: 4 additions & 6 deletions make/template/inspircd
Original file line number Diff line number Diff line change
Expand Up @@ -242,14 +242,13 @@ sub dev_valdebug(@)
print "$binpath/$executable doesn't exist\n" and return 0 unless(-e "$binpath/$executable");
print "$binpath/$executable is not executable\n" and return 0 unless(-f "$binpath/$executable" && -x "$binpath/$executable");

# Check we have valgrind and gdb
# Check we have valgrind
checkvalgrind();
checkgdb();

# If we are still alive here.. Try starting the IRCd..
# May want to do something with these args at some point: --suppressions=.inspircd.sup --gen-suppressions=yes
# Could be useful when we want to stop it complaining about things we're sure aren't issues.
exec qw(valgrind -v --tool=memcheck --leak-check=yes --db-attach=yes --num-callers=30), "$binpath/$executable", qw(--nofork --debug --nolog), @_;
exec qw(valgrind -v --tool=memcheck --leak-check=yes --num-callers=30), "$binpath/$executable", qw(--nofork --debug --nolog), @_;
die "Failed to start valgrind: $!\n";
}

Expand All @@ -262,9 +261,8 @@ sub dev_valdebug_unattended(@)
print "$binpath/$executable doesn't exist\n" and return 0 unless(-e "$binpath/$executable");
print "$binpath/$executable is not executable\n" and return 0 unless(-f "$binpath/$executable" && -x "$binpath/$executable");

# Check we have valgrind and gdb
# Check we have valgrind
checkvalgrind();
checkgdb();

# If we are still alive here.. Try starting the IRCd..
#
Expand Down Expand Up @@ -306,7 +304,7 @@ sub dev_screenvaldebug(@)
# If we are still alive here.. Try starting the IRCd..
print "Starting InspIRCd in `screen`, type `screen -r` when the ircd crashes to view the valgrind and gdb output and get a backtrace.\n";
print "Once you're inside the screen session press ^C + d to re-detach from the session\n";
exec qw(screen -m -d valgrind -v --tool=memcheck --leak-check=yes --db-attach=yes --num-callers=30), "$binpath/$executable", qw(--nofork --debug --nolog), @_;
exec qw(screen -m -d valgrind -v --tool=memcheck --leak-check=yes --num-callers=30), "$binpath/$executable", qw(--nofork --debug --nolog), @_;
die "Failed to start screen: $!\n";
}

Expand Down
6 changes: 4 additions & 2 deletions src/modules/extra/m_ssl_gnutls.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1300,6 +1300,7 @@ class ModuleSSLGnuTLS : public Module
// First member of the class, gets constructed first and destructed last
GnuTLS::Init libinit;
ProfileList profiles;
TR1NS::function<void(char*, size_t)> rememberer;

void ReadProfiles()
{
Expand Down Expand Up @@ -1373,6 +1374,7 @@ class ModuleSSLGnuTLS : public Module

public:
ModuleSSLGnuTLS()
: rememberer(ServerInstance->GenRandom)
{
#ifndef GNUTLS_HAS_RND
gcry_control (GCRYCTL_INITIALIZATION_FINISHED, 0);
Expand All @@ -1383,7 +1385,7 @@ class ModuleSSLGnuTLS : public Module
void init() CXX11_OVERRIDE
{
ServerInstance->Logs->Log(MODNAME, LOG_DEFAULT, "GnuTLS lib version %s module was compiled for " GNUTLS_VERSION, gnutls_check_version(NULL));
ServerInstance->GenRandom = RandGen::Call;
ServerInstance->GenRandom = &RandGen::Call;
}

void ReadConfig(ConfigStatus& status) CXX11_OVERRIDE
Expand Down Expand Up @@ -1411,7 +1413,7 @@ class ModuleSSLGnuTLS : public Module

~ModuleSSLGnuTLS()
{
ServerInstance->GenRandom = &InspIRCd::DefaultGenRandom;
ServerInstance->GenRandom = rememberer;
}

void OnCleanup(ExtensionItem::ExtensibleType type, Extensible* item) CXX11_OVERRIDE
Expand Down
5 changes: 5 additions & 0 deletions src/modules/m_alias.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -370,6 +370,11 @@ class ModuleAlias : public Module
result.append(a->RequiredNick);
i += 11;
}
else if (!newline.compare(i, 6, "$address", 8))
{
result.append(user->GetIPString());
i += 7;
}
else
result.push_back(c);
}
Expand Down
17 changes: 8 additions & 9 deletions src/modules/m_svshold.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -48,16 +48,20 @@ class SVSHold : public XLine
{
}

void Apply(User* u) CXX11_OVERRIDE
{
u->WriteNumeric(RPL_SAVENICK, u->nick, InspIRCd::Format("Services reserved nickname: %s", reason.c_str()));
u->ChangeNick(u->uuid);
}

bool Matches(User* u) CXX11_OVERRIDE
{
if (u->nick == nickname)
return true;
return false;
return irc::equals(u->nick, nickname);
}

bool Matches(const std::string& s) CXX11_OVERRIDE
{
return InspIRCd::Match(s, nickname);
return irc::equals(s, nickname);
}

void DisplayExpiry() CXX11_OVERRIDE
Expand Down Expand Up @@ -85,11 +89,6 @@ class SVSHoldFactory : public XLineFactory
{
return new SVSHold(set_time, duration, source, reason, xline_specific_mask);
}

bool AutoApplyToUserList(XLine* x) CXX11_OVERRIDE
{
return false;
}
};

/** Handle /SVSHold
Expand Down
4 changes: 2 additions & 2 deletions vendor/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ This directory contains vendored dependencies that are shipped with InspIRCd to

**License** &mdash; MIT License

**Version** &mdash; debian/2.9.4-5
**Version** &mdash; debian/2.9.4-6

**Website** &mdash; [https://git.in-ulm.de/cbiedl/http-parser](https://git.in-ulm.de/cbiedl/http-parser)

Expand All @@ -38,7 +38,7 @@ This directory contains vendored dependencies that are shipped with InspIRCd to

**License** &mdash; Boost Software License

**Version** &mdash; v3.2.3
**Version** &mdash; v4.0.2

**Website** &mdash; [https://github.com/nemtrif/utfcpp](https://github.com/nemtrif/utfcpp)

Expand Down
Loading

0 comments on commit 56d1fe4

Please sign in to comment.