Merge branch 'insp3' into master.

This commit is contained in:
Sadie Powell 2023-11-14 15:10:23 +00:00
commit 59845198e1
6 changed files with 24 additions and 13 deletions

3
.gitignore vendored
View File

@ -9,6 +9,9 @@
/GNUmakefile
/build
/core
/core.*
/vgcore
/vgcore.*
/docs/doxygen
/run

View File

@ -111,10 +111,9 @@
# 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, $user, #
# $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; #
# #
# requires - If you provide a value for 'requires' this means #
# the given nickname MUST be online for the alias #

View File

@ -25,6 +25,11 @@
# Identifies to a services account.
<alias text="ID" format="*" replace="SQUERY $requirement :IDENTIFY $2-" requires="NickServ" service="yes">
<alias text="IDENTIFY" format="*" replace="SQUERY $requirement :IDENTIFY $2-" requires="NickServ" service="yes">
<alias text="LOGIN" format="*" replace="SQUERY $requirement :IDENTIFY $2-" requires="NickServ" service="yes">
# /LOGOUT
# Logs out of a services account.
<alias text="LOGOUT" format="*" replace="SQUERY $requirement :LOGOUT" requires="NickServ" service="yes">
# Prevent clients from using the nicknames of services pseudoclients.
<badnick nick="BotServ" reason="Reserved for a network service">

View File

@ -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";
}
@ -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..
#
@ -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";
}

View File

@ -1122,6 +1122,7 @@ class ModuleSSLGnuTLS final
// First member of the class, gets constructed first and destructed last
GnuTLS::Init libinit;
ProfileList profiles;
std::function<void(char*, size_t)> rememberer;
void ReadProfiles()
{
@ -1174,6 +1175,7 @@ class ModuleSSLGnuTLS final
public:
ModuleSSLGnuTLS()
: Module(VF_VENDOR, "Allows TLS encrypted connections using the GnuTLS library.")
, rememberer(ServerInstance->GenRandom)
{
thismod = this;
}
@ -1182,8 +1184,7 @@ public:
{
ServerInstance->Logs.Normal(MODNAME, "Module was compiled against GnuTLS version {} and is running against version {}",
GNUTLS_VERSION, gnutls_check_version(nullptr));
ServerInstance->GenRandom = GnuTLS::GenRandom;
ServerInstance->GenRandom = &GnuTLS::GenRandom;
}
void ReadConfig(ConfigStatus& status) override
@ -1219,7 +1220,7 @@ public:
~ModuleSSLGnuTLS() override
{
ServerInstance->GenRandom = &InspIRCd::DefaultGenRandom;
ServerInstance->GenRandom = rememberer;
}
void OnCleanup(ExtensionType type, Extensible* item) override

View File

@ -366,6 +366,11 @@ public:
result.append(a.RequiredNick);
i += 11;
}
else if (!newline.compare(i, 6, "$address", 8))
{
result.append(user->GetAddress());
i += 7;
}
else if (!newline.compare(i, 6, "$ident", 6))
{
// TODO: remove this in the next major release.