Merge branch 'insp3' into master.

This commit is contained in:
Sadie Powell 2020-08-25 10:40:54 +01:00
commit 73b4ac1b3a
27 changed files with 114 additions and 110 deletions

115
configure vendored
View File

@ -394,6 +394,17 @@ EOQ
if (<$RealDir/src/modules/m_ssl_*.cpp>) {
if (prompt_bool $interactive, $question, $interactive) {
system './tools/genssl', 'auto';
} else {
my @pems = <$RealDir/{cert,csr,dhparams,key}.pem>;
$question = <<EOQ;
The following self-signed files were previously generated and will be installed
when you run Make. Do you want to delete them?
* ${\join "\n * ", @pems}
EOQ
if (@pems && prompt_bool $interactive, $question, 0) {
unlink @pems;
}
}
} else {
print_warning <<"EOM";
@ -553,72 +564,56 @@ EXTRA: for my $extra (@extras) {
return keys(%extras) if wantarray; # Can be used by manage_extras.
}
sub enable_extras (@) {
my (@extras) = @_;
for my $extra (@extras) {
$extra = "m_$extra" unless $extra =~ /^m_/;
$extra = "$extra.cpp" unless $extra =~ /\.cpp$/;
my $extrapath = "src/modules/extra/$extra";
if (!-e $extrapath) {
print STDERR "Cannot enable \e[32;1m$extra\e[0m : No such file or directory in src/modules/extra\n";
next;
sub enable_extras(@) {
my $moduledir = catdir $RealDir, 'src', 'modules';
my $extradir = catdir $moduledir, 'extra';
for my $extra (@_) {
my $shortname = $extra =~ s/(?:^m_|\.cpp$)//gr;
my $extrafile = "m_$shortname.cpp";
my $extrapath = catfile $extradir, $extrafile;
if (!-f $extrapath) {
print_error "<|GREEN $extra|> is not an extra module!";
}
my $source = "src/modules/$extra";
if (-e $source) {
print STDERR "Cannot enable \e[32;1m$extra\e[0m : destination in src/modules exists (might already be enabled?)\n";
next;
}
# Get dependencies, and add them to be processed.
my @deps = split /\s+/, get_directive($extrapath, 'ModDep', '');
for my $dep (@deps) {
next if scalar(grep { $_ eq $dep } (@extras)) > 0; # Skip if we're going to be enabling it anyway.
if (!-e "src/modules/$dep" && !-e "include/$dep") {
if (-e "src/modules/extra/$dep") {
print STDERR "Will also enable extra \e[32;1m$dep\e[0m (needed by \e[32;1m$extra\e[0m)\n";
push @extras, $dep;
} else {
print STDERR "\e[33;1mWARNING:\e[0m module \e[32;1m$extra\e[0m might be missing dependency \e[32;1m$dep\e[0m - YOU are responsible for satisfying it!\n";
}
my $modulepath = catfile $moduledir, $extrafile;
if (-l $modulepath) {
if (readlink($modulepath) ne $extrapath) {
unlink $modulepath; # Remove the dead symlink.
} else {
next; # Module is already enabled.
}
}
print "Enabling $extra ... \n";
symlink "extra/$extra", $source or print STDERR "$source: Cannot link to 'extra/$extra': $!\n";
if (-e $modulepath) {
print_error "unable to symlink <|GREEN ${\abs2rel $modulepath}|> to <|GREEN ${\abs2rel $extrapath}|>: the target exists and is not a symlink.";
} else {
print_format "Enabling the <|GREEN $shortname|> module ...\n";
symlink $extrapath, $modulepath or print_error "unable to symlink <|GREEN ${\abs2rel $modulepath}|> to <|GREEN ${\abs2rel $extrapath}|>: $!";
}
}
}
sub disable_extras (@)
{
opendir my $dd, "src/modules/extra/";
my @files = readdir($dd);
closedir $dd;
my (@extras) = @_;
EXTRA: for my $extra (@extras) {
$extra = "m_$extra" unless $extra =~ /^m_/;
$extra = "$extra.cpp" unless $extra =~ /\.cpp$/;
my $extrapath = "src/modules/extra/$extra";
my $source = "src/modules/$extra";
if (!-e $extrapath) {
print STDERR "Cannot disable \e[32;1m$extra\e[0m : Is not an extra\n";
next;
sub disable_extras(@) {
my $moduledir = catdir $RealDir, 'src', 'modules';
my $extradir = catdir $moduledir, 'extra';
for my $extra (@_) {
my $shortname = $extra =~ s/(?:^m_|\.cpp$)//gr;
my $extrafile = "m_$shortname.cpp";
my $modulepath = catfile $moduledir, $extrafile;
my $extrapath = catfile $extradir, $extrafile;
if (!-e $modulepath && !-e $extrapath) {
print_error "the <|GREEN $shortname|> module does not exist!";
} elsif (!-e $modulepath && -e $extrapath) {
print_error "the <|GREEN $shortname|> module is not currently enabled!";
} elsif ((-e $modulepath && !-e $extrapath) || !-l $modulepath) {
print_error "the <|GREEN $shortname|> module is not an extra module!";
} else {
print_format "Disabling the <|GREEN $shortname|> module ...\n";
unlink $modulepath or print_error "unable to unlink <|GREEN $extrapath|>: $!";
}
if ((! -l $source) || readlink($source) ne "extra/$extra") {
print STDERR "Cannot disable \e[32;1m$extra\e[0m : Source is not a link or doesn't refer to the right file. Remove manually if this is in error.\n";
next;
}
# Check if anything needs this.
for my $file (@files) {
my @deps = split /\s+/, get_directive("src/modules/extra/$file", 'ModDep', '');
# File depends on this extra...
if (scalar(grep { $_ eq $extra } @deps) > 0) {
# And is both enabled and not about to be disabled.
if (-e "src/modules/$file" && scalar(grep { $_ eq $file } @extras) < 1) {
print STDERR "Cannot disable \e[32;1m$extra\e[0m : is needed by \e[32;1m$file\e[0m\n";
next EXTRA;
}
}
}
# Now remove.
print "Disabling $extra ... \n";
unlink "src/modules/$extra" or print STDERR "Cannot disable \e[32;1m$extra\e[0m : $!\n";
}
}

View File

@ -236,9 +236,6 @@
# To enable IRCCloud on your network uncomment this:
#<include file="examples/providers/irccloud.conf.example">
# To enable KiwiIRC.com on your network uncomment this:
#<include file="examples/providers/kiwiirc-com.conf.example">
# A connect class with <connect:deny> set denies connections from the specified host/IP range.
<connect
# deny: Will not let people connect if they have specified host/IP.

View File

@ -1,19 +0,0 @@
# This file contains connect classes which are used by KiwiIRC.com users.
# See https://kiwiirc.com for more information on KiwiIRC.com.
<connect name="KiwiIRC.com"
parent="main"
globalmax="100"
localmax="100"
registered="no"
resolvehostnames="no"
usednsbl="no"
useident="no">
<connect name="KiwiIRC.com-1" parent="KiwiIRC.com" allow="107.161.19.53">
<connect name="KiwiIRC.com-2" parent="KiwiIRC.com" allow="107.161.19.109">
<connect name="KiwiIRC.com-3" parent="KiwiIRC.com" allow="109.169.31.4">
<exception host="*@107.161.19.53" reason="KiwiIRC.com WebIRC Gateway">
<exception host="*@107.161.19.109" reason="KiwiIRC.com WebIRC Gateway">
<exception host="*@107.169.31.4" reason="KiwiIRC.com WebIRC Gateway">

View File

@ -1,6 +1,7 @@
/*
* InspIRCd -- Internet Relay Chat Daemon
*
* Copyright (C) 2020 Matt Schatz <genius3000@g3k.solutions>
* Copyright (C) 2019 linuxdaemon <linuxdaemon.irc@gmail.com>
* Copyright (C) 2013, 2015-2016 Attila Molnar <attilamolnar@hush.com>
* Copyright (C) 2012-2013, 2017-2019 Sadie Powell <sadie@witchery.services>

View File

@ -228,7 +228,7 @@ class Numerics::CannotSendTo : public Numeric::Numeric
: Numeric(ERR_CANNOTSENDTOCHAN)
{
push(chan->name);
push(InspIRCd::Format("You cannot send %s to this channel whilst %s %c: (%s) extban is set on you.",
push(InspIRCd::Format("You cannot send %s to this channel whilst %s %c: (%s) extban is set matching you.",
what.c_str(), strchr("AEIOUaeiou", extban) ? "an" : "a", extban, extbandesc.c_str()));
}

View File

@ -1,7 +1,7 @@
#
# InspIRCd -- Internet Relay Chat Daemon
#
# Copyright (C) 2013-2019 Sadie Powell <sadie@witchery.services>
# Copyright (C) 2013-2020 Sadie Powell <sadie@witchery.services>
# Copyright (C) 2012 Robby <robby@chatbelgie.be>
# Copyright (C) 2007-2008 Craig Edwards <brain@inspircd.org>
# Copyright (C) 2007 Dennis Friis <peavey@inspircd.org>
@ -177,6 +177,7 @@ FLAGS
If you have any problems with configuring InspIRCd then visit our IRC channel
at irc.inspircd.org #InspIRCd for support.
Packagers: see https://docs.inspircd.org/packaging/ for packaging advice.
EOH
exit 0;
}

View File

@ -1,7 +1,7 @@
/*
* InspIRCd -- Internet Relay Chat Daemon
*
* Copyright (C) 2014, 2016, 2018-2019 Sadie Powell <sadie@witchery.services>
* Copyright (C) 2014, 2016, 2018-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

View File

@ -4,7 +4,7 @@
#
# Copyright (C) 2019 Robby <robby@chatbelgie.be>
# Copyright (C) 2015 Attila Molnar <attilamolnar@hush.com>
# Copyright (C) 2014, 2017, 2019 Sadie Powell <sadie@witchery.services>
# Copyright (C) 2014, 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

View File

@ -2,7 +2,7 @@
#
# InspIRCd -- Internet Relay Chat Daemon
#
# Copyright (C) 2012-2014, 2017-2019 Sadie Powell <sadie@witchery.services>
# Copyright (C) 2012-2014, 2017-2020 Sadie Powell <sadie@witchery.services>
# Copyright (C) 2012 Robby <robby@chatbelgie.be>
# Copyright (C) 2009-2010 Daniel De Graaf <danieldg@inspircd.org>
# Copyright (C) 2008-2009 Robin Burchell <robin+git@viroteck.net>

View File

@ -1,7 +1,7 @@
/*
* InspIRCd -- Internet Relay Chat Daemon
*
* Copyright (C) 2017-2019 Sadie Powell <sadie@witchery.services>
* Copyright (C) 2017-2020 Sadie Powell <sadie@witchery.services>
* Copyright (C) 2013-2015 Attila Molnar <attilamolnar@hush.com>
* Copyright (C) 2012 Robby <robby@chatbelgie.be>
* Copyright (C) 2009 Uli Schlachter <psychon@inspircd.org>

View File

@ -1,7 +1,7 @@
/*
* InspIRCd -- Internet Relay Chat Daemon
*
* Copyright (C) 2013, 2017-2018 Sadie Powell <sadie@witchery.services>
* Copyright (C) 2013, 2017-2018, 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) 2009-2010 Daniel De Graaf <danieldg@inspircd.org>

View File

@ -1,7 +1,7 @@
/*
* InspIRCd -- Internet Relay Chat Daemon
*
* Copyright (C) 2013, 2019 Sadie Powell <sadie@witchery.services>
* Copyright (C) 2013, 2019-2020 Sadie Powell <sadie@witchery.services>
* Copyright (C) 2013 Attila Molnar <attilamolnar@hush.com>
*
* This file is part of InspIRCd. InspIRCd is free software: you can

View File

@ -1,6 +1,7 @@
/*
* InspIRCd -- Internet Relay Chat Daemon
*
* Copyright (C) 2020 Matt Schatz <genius3000@g3k.solutions>
* Copyright (C) 2018 Chris Novakovic <chrisnovakovic@users.noreply.github.com>
* Copyright (C) 2013, 2017-2020 Sadie Powell <sadie@witchery.services>
* Copyright (C) 2013 Adam <Adam@anope.org>

View File

@ -1,6 +1,7 @@
/*
* InspIRCd -- Internet Relay Chat Daemon
*
* Copyright (C) 2020 Matt Schatz <genius3000@g3k.solutions>
* Copyright (C) 2019 linuxdaemon <linuxdaemon.irc@gmail.com>
* Copyright (C) 2018 Dylan Frank <b00mx0r@aureus.pw>
* Copyright (C) 2013-2016 Attila Molnar <attilamolnar@hush.com>

View File

@ -1,7 +1,7 @@
/*
* InspIRCd -- Internet Relay Chat Daemon
*
* Copyright (C) 2017-2018 Sadie Powell <sadie@witchery.services>
* Copyright (C) 2017-2018, 2020 Sadie Powell <sadie@witchery.services>
* Copyright (C) 2014 Daniel Vassdal <shutter@canternet.org>
*
* This file is part of InspIRCd. InspIRCd is free software: you can

View File

@ -55,7 +55,7 @@ class ModuleDisable : public Module
// Check that the mode actually exists.
ModeHandler* mh = ServerInstance->Modes.FindMode(chr, type);
if (!chr)
if (!mh)
throw ModuleException(InspIRCd::Format("Nonexistent mode '%c' was specified in <disabled:%s> at %s",
chr, field.c_str(), tag->getTagLocation().c_str()));

View File

@ -1,8 +1,8 @@
/*
* InspIRCd -- Internet Relay Chat Daemon
*
* Copyright (C) 2018, 2020 Sadie Powell <sadie@witchery.services>
* Copyright (C) 2018 linuxdaemon <linuxdaemon.irc@gmail.com>
* Copyright (C) 2018 Sadie Powell <sadie@witchery.services>
* Copyright (C) 2014, 2016 Attila Molnar <attilamolnar@hush.com>
* Copyright (C) 2014 Daniel Vassdal <shutter@canternet.org>
*

View File

@ -4,7 +4,6 @@
* Copyright (C) 2013, 2018-2020 Sadie Powell <sadie@witchery.services>
* Copyright (C) 2012, 2019 Robby <robby@chatbelgie.be>
* Copyright (C) 2012 Attila Molnar <attilamolnar@hush.com>
* Copyright (C) 2010 Craig Edwards <brain@inspircd.org>
* Copyright (C) 2009 Daniel De Graaf <danieldg@inspircd.org>
* Copyright (C) 2007 John Brooks <special@inspircd.org>
* Copyright (C) 2007 Dennis Friis <peavey@inspircd.org>

View File

@ -2,7 +2,7 @@
* InspIRCd -- Internet Relay Chat Daemon
*
* Copyright (C) 2017 B00mX0r <b00mx0r@aureus.pw>
* Copyright (C) 2016, 2018-2019 Sadie Powell <sadie@witchery.services>
* Copyright (C) 2016, 2018-2020 Sadie Powell <sadie@witchery.services>
* Copyright (C) 2014 Adam <Adam@anope.org>
* Copyright (C) 2013-2016 Attila Molnar <attilamolnar@hush.com>
* Copyright (C) 2012 Robby <robby@chatbelgie.be>

View File

@ -1,7 +1,7 @@
/*
* InspIRCd -- Internet Relay Chat Daemon
*
* Copyright (C) 2019 Matt Schatz <genius3000@g3k.solutions>
* Copyright (C) 2019-2020 Matt Schatz <genius3000@g3k.solutions>
* Copyright (C) 2018 linuxdaemon <linuxdaemon.irc@gmail.com>
* Copyright (C) 2013, 2017-2018, 2020 Sadie Powell <sadie@witchery.services>
* Copyright (C) 2012, 2018-2019 Robby <robby@chatbelgie.be>

View File

@ -1,6 +1,7 @@
/*
* InspIRCd -- Internet Relay Chat Daemon
*
* Copyright (C) 2020 iwalkalone <iwalkalone69@gmail.com>
* Copyright (C) 2018 linuxdaemon <linuxdaemon.irc@gmail.com>
* Copyright (C) 2017 B00mX0r <b00mx0r@aureus.pw>
* Copyright (C) 2016, 2019 Matt Schatz <genius3000@g3k.solutions>

2
vendor/README.md vendored
View File

@ -48,7 +48,7 @@ This directory contains vendored dependencies that are shipped with InspIRCd to
**License** &mdash; Boost Software License
**Version** &mdash; v3.1
**Version** &mdash; v3.1.1
**Website** &mdash; [https://github.com/nemtrif/utfcpp](https://github.com/nemtrif/utfcpp)

6
vendor/update vendored
View File

@ -50,7 +50,7 @@ close $fh;
my ($data, $error) = from_toml $contents;
print_error "unable to parse $config: $!" if $error;
while (my ($name, $info) = each $data) {
while (my ($name, $info) = each %{$data}) {
print_format "Updating <|GREEN $name|> ...\n";
my $unpackdir = File::Temp->newdir;
@ -91,7 +91,7 @@ close $fh;
open($fh, '>', $readme) or print_error "unable to write $readme: $!";
print $fh $contents =~ s/\n\#\#.*//rs;
for my $name (sort keys $data) {
for my $name (sort keys %{$data}) {
my $info = $data->{$name};
printf $fh "\n## %s\n\n", $name;
printf $fh "**Author** &mdash; [%s](mailto:%s)\n\n", $info->{author}, $info->{email} if $info->{email};
@ -101,4 +101,4 @@ for my $name (sort keys $data) {
my $website = $info->{website} // $info->{git};
printf $fh "**Website** &mdash; [%s](%s)\n", $website, $website;
}
close $fh;
close $fh;

View File

@ -31,8 +31,4 @@ DEALINGS IN THE SOFTWARE.
#include "utf8/checked.h"
#include "utf8/unchecked.h"
#if __cplusplus >= 201103L // C++ 11 or later
#include "utf8/cpp11.h"
#endif // C++ 11 or later
#endif // header guard

View File

@ -42,7 +42,7 @@ namespace utf8
uint32_t cp;
public:
invalid_code_point(uint32_t codepoint) : cp(codepoint) {}
virtual const char* what() const throw() { return "Invalid code point"; }
virtual const char* what() const NOEXCEPT OVERRIDE { return "Invalid code point"; }
uint32_t code_point() const {return cp;}
};
@ -50,7 +50,7 @@ namespace utf8
uint8_t u8;
public:
invalid_utf8 (uint8_t u) : u8(u) {}
virtual const char* what() const throw() { return "Invalid UTF-8"; }
virtual const char* what() const NOEXCEPT OVERRIDE { return "Invalid UTF-8"; }
uint8_t utf8_octet() const {return u8;}
};
@ -58,13 +58,13 @@ namespace utf8
uint16_t u16;
public:
invalid_utf16 (uint16_t u) : u16(u) {}
virtual const char* what() const throw() { return "Invalid UTF-16"; }
virtual const char* what() const NOEXCEPT OVERRIDE { return "Invalid UTF-16"; }
uint16_t utf16_word() const {return u16;}
};
class not_enough_room : public exception {
public:
virtual const char* what() const throw() { return "Not enough space"; }
virtual const char* what() const NOEXCEPT OVERRIDE { return "Not enough space"; }
};
/// The library API - functions intended to be called by the users
@ -263,11 +263,16 @@ namespace utf8
// The iterator class
template <typename octet_iterator>
class iterator : public std::iterator <std::bidirectional_iterator_tag, uint32_t> {
class iterator {
octet_iterator it;
octet_iterator range_start;
octet_iterator range_end;
public:
typedef uint32_t value_type;
typedef uint32_t* pointer;
typedef uint32_t& reference;
typedef std::ptrdiff_t difference_type;
typedef std::bidirectional_iterator_tag iterator_category;
iterator () {}
explicit iterator (const octet_iterator& octet_it,
const octet_iterator& rangestart,
@ -320,5 +325,9 @@ namespace utf8
} // namespace utf8
#if UTF_CPP_CPLUSPLUS >= 201103L // C++ 11 or later
#include "cpp11.h"
#endif // C++ 11 or later
#endif //header guard

View File

@ -30,6 +30,23 @@ DEALINGS IN THE SOFTWARE.
#include <iterator>
// Determine the C++ standard version.
// If the user defines UTF_CPP_CPLUSPLUS, use that.
// Otherwise, trust the unreliable predefined macro __cplusplus
#if !defined UTF_CPP_CPLUSPLUS
#define UTF_CPP_CPLUSPLUS __cplusplus
#endif
#if UTF_CPP_CPLUSPLUS >= 201103L // C++ 11 or later
#define OVERRIDE override
#define NOEXCEPT noexcept
#else // C++ 98/03
#define OVERRIDE
#define NOEXCEPT throw()
#endif // C++ 11 or later
namespace utf8
{
// The typedefs for 8-bit, 16-bit and 32-bit unsigned integers

View File

@ -217,9 +217,14 @@ namespace utf8
// The iterator class
template <typename octet_iterator>
class iterator : public std::iterator <std::bidirectional_iterator_tag, uint32_t> {
class iterator {
octet_iterator it;
public:
typedef uint32_t value_type;
typedef uint32_t* pointer;
typedef uint32_t& reference;
typedef std::ptrdiff_t difference_type;
typedef std::bidirectional_iterator_tag iterator_category;
iterator () {}
explicit iterator (const octet_iterator& octet_it): it(octet_it) {}
// the default "big three" are OK