diff --git a/configure b/configure index 5de4c7903..ecf568742 100755 --- a/configure +++ b/configure @@ -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 = < 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"; } } diff --git a/docs/conf/inspircd.conf.example b/docs/conf/inspircd.conf.example index 7c2f67b59..288fef090 100644 --- a/docs/conf/inspircd.conf.example +++ b/docs/conf/inspircd.conf.example @@ -236,9 +236,6 @@ # To enable IRCCloud on your network uncomment this: # -# To enable KiwiIRC.com on your network uncomment this: -# - # A connect class with set denies connections from the specified host/IP range. - - - - - - - - diff --git a/include/inspsocket.h b/include/inspsocket.h index 1b981b0e2..d5cdb9b57 100644 --- a/include/inspsocket.h +++ b/include/inspsocket.h @@ -1,6 +1,7 @@ /* * InspIRCd -- Internet Relay Chat Daemon * + * Copyright (C) 2020 Matt Schatz * Copyright (C) 2019 linuxdaemon * Copyright (C) 2013, 2015-2016 Attila Molnar * Copyright (C) 2012-2013, 2017-2019 Sadie Powell diff --git a/include/numericbuilder.h b/include/numericbuilder.h index 3a49d1e76..69b9052e7 100644 --- a/include/numericbuilder.h +++ b/include/numericbuilder.h @@ -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())); } diff --git a/make/configure.pm b/make/configure.pm index 0837f316c..7c4fec6a0 100644 --- a/make/configure.pm +++ b/make/configure.pm @@ -1,7 +1,7 @@ # # InspIRCd -- Internet Relay Chat Daemon # -# Copyright (C) 2013-2019 Sadie Powell +# Copyright (C) 2013-2020 Sadie Powell # Copyright (C) 2012 Robby # Copyright (C) 2007-2008 Craig Edwards # Copyright (C) 2007 Dennis Friis @@ -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; } diff --git a/make/template/config.h b/make/template/config.h index f077a5aa8..a4a21250a 100644 --- a/make/template/config.h +++ b/make/template/config.h @@ -1,7 +1,7 @@ /* * InspIRCd -- Internet Relay Chat Daemon * - * Copyright (C) 2014, 2016, 2018-2019 Sadie Powell + * Copyright (C) 2014, 2016, 2018-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/make/template/inspircd.service b/make/template/inspircd.service index a389d488b..8d643f6e9 100644 --- a/make/template/inspircd.service +++ b/make/template/inspircd.service @@ -4,7 +4,7 @@ # # Copyright (C) 2019 Robby # Copyright (C) 2015 Attila Molnar -# Copyright (C) 2014, 2017, 2019 Sadie Powell +# Copyright (C) 2014, 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/modulemanager b/modulemanager index 79ec23dbf..1be9f52f9 100755 --- a/modulemanager +++ b/modulemanager @@ -2,7 +2,7 @@ # # InspIRCd -- Internet Relay Chat Daemon # -# Copyright (C) 2012-2014, 2017-2019 Sadie Powell +# Copyright (C) 2012-2014, 2017-2020 Sadie Powell # Copyright (C) 2012 Robby # Copyright (C) 2009-2010 Daniel De Graaf # Copyright (C) 2008-2009 Robin Burchell diff --git a/src/coremods/core_channel/cmode_k.cpp b/src/coremods/core_channel/cmode_k.cpp index c383cf837..e788fd342 100644 --- a/src/coremods/core_channel/cmode_k.cpp +++ b/src/coremods/core_channel/cmode_k.cpp @@ -1,7 +1,7 @@ /* * InspIRCd -- Internet Relay Chat Daemon * - * Copyright (C) 2017-2019 Sadie Powell + * Copyright (C) 2017-2020 Sadie Powell * Copyright (C) 2013-2015 Attila Molnar * Copyright (C) 2012 Robby * Copyright (C) 2009 Uli Schlachter diff --git a/src/coremods/core_info/cmd_commands.cpp b/src/coremods/core_info/cmd_commands.cpp index 74b0e67f3..bf9742a31 100644 --- a/src/coremods/core_info/cmd_commands.cpp +++ b/src/coremods/core_info/cmd_commands.cpp @@ -1,7 +1,7 @@ /* * InspIRCd -- Internet Relay Chat Daemon * - * Copyright (C) 2013, 2017-2018 Sadie Powell + * Copyright (C) 2013, 2017-2018, 2020 Sadie Powell * Copyright (C) 2012, 2014, 2016 Attila Molnar * Copyright (C) 2012 Robby * Copyright (C) 2009-2010 Daniel De Graaf diff --git a/src/fileutils.cpp b/src/fileutils.cpp index c9f547c30..3dca154a7 100644 --- a/src/fileutils.cpp +++ b/src/fileutils.cpp @@ -1,7 +1,7 @@ /* * InspIRCd -- Internet Relay Chat Daemon * - * Copyright (C) 2013, 2019 Sadie Powell + * Copyright (C) 2013, 2019-2020 Sadie Powell * Copyright (C) 2013 Attila Molnar * * This file is part of InspIRCd. InspIRCd is free software: you can diff --git a/src/inspircd.cpp b/src/inspircd.cpp index 1f2c3ce60..3e825848c 100644 --- a/src/inspircd.cpp +++ b/src/inspircd.cpp @@ -1,6 +1,7 @@ /* * InspIRCd -- Internet Relay Chat Daemon * + * Copyright (C) 2020 Matt Schatz * Copyright (C) 2018 Chris Novakovic * Copyright (C) 2013, 2017-2020 Sadie Powell * Copyright (C) 2013 Adam diff --git a/src/inspsocket.cpp b/src/inspsocket.cpp index e20f9a3b2..74c4d5283 100644 --- a/src/inspsocket.cpp +++ b/src/inspsocket.cpp @@ -1,6 +1,7 @@ /* * InspIRCd -- Internet Relay Chat Daemon * + * Copyright (C) 2020 Matt Schatz * Copyright (C) 2019 linuxdaemon * Copyright (C) 2018 Dylan Frank * Copyright (C) 2013-2016 Attila Molnar diff --git a/src/modules/m_bcrypt.cpp b/src/modules/m_bcrypt.cpp index 685a82f87..2050b94ae 100644 --- a/src/modules/m_bcrypt.cpp +++ b/src/modules/m_bcrypt.cpp @@ -1,7 +1,7 @@ /* * InspIRCd -- Internet Relay Chat Daemon * - * Copyright (C) 2017-2018 Sadie Powell + * Copyright (C) 2017-2018, 2020 Sadie Powell * Copyright (C) 2014 Daniel Vassdal * * This file is part of InspIRCd. InspIRCd is free software: you can diff --git a/src/modules/m_disable.cpp b/src/modules/m_disable.cpp index 13ce99bc9..7237fb350 100644 --- a/src/modules/m_disable.cpp +++ b/src/modules/m_disable.cpp @@ -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 at %s", chr, field.c_str(), tag->getTagLocation().c_str())); diff --git a/src/modules/m_pbkdf2.cpp b/src/modules/m_pbkdf2.cpp index e990d61fc..706c61e89 100644 --- a/src/modules/m_pbkdf2.cpp +++ b/src/modules/m_pbkdf2.cpp @@ -1,8 +1,8 @@ /* * InspIRCd -- Internet Relay Chat Daemon * + * Copyright (C) 2018, 2020 Sadie Powell * Copyright (C) 2018 linuxdaemon - * Copyright (C) 2018 Sadie Powell * Copyright (C) 2014, 2016 Attila Molnar * Copyright (C) 2014 Daniel Vassdal * diff --git a/src/modules/m_setname.cpp b/src/modules/m_setname.cpp index c2de21045..e5cf8feca 100644 --- a/src/modules/m_setname.cpp +++ b/src/modules/m_setname.cpp @@ -4,7 +4,6 @@ * Copyright (C) 2013, 2018-2020 Sadie Powell * Copyright (C) 2012, 2019 Robby * Copyright (C) 2012 Attila Molnar - * Copyright (C) 2010 Craig Edwards * Copyright (C) 2009 Daniel De Graaf * Copyright (C) 2007 John Brooks * Copyright (C) 2007 Dennis Friis diff --git a/src/modules/m_spanningtree/override_map.cpp b/src/modules/m_spanningtree/override_map.cpp index 375803903..f70b6da1e 100644 --- a/src/modules/m_spanningtree/override_map.cpp +++ b/src/modules/m_spanningtree/override_map.cpp @@ -2,7 +2,7 @@ * InspIRCd -- Internet Relay Chat Daemon * * Copyright (C) 2017 B00mX0r - * Copyright (C) 2016, 2018-2019 Sadie Powell + * Copyright (C) 2016, 2018-2020 Sadie Powell * Copyright (C) 2014 Adam * Copyright (C) 2013-2016 Attila Molnar * Copyright (C) 2012 Robby diff --git a/src/modules/m_svshold.cpp b/src/modules/m_svshold.cpp index 98060f06f..69b987433 100644 --- a/src/modules/m_svshold.cpp +++ b/src/modules/m_svshold.cpp @@ -1,7 +1,7 @@ /* * InspIRCd -- Internet Relay Chat Daemon * - * Copyright (C) 2019 Matt Schatz + * Copyright (C) 2019-2020 Matt Schatz * Copyright (C) 2018 linuxdaemon * Copyright (C) 2013, 2017-2018, 2020 Sadie Powell * Copyright (C) 2012, 2018-2019 Robby diff --git a/src/modules/m_timedbans.cpp b/src/modules/m_timedbans.cpp index b67a1b95d..0c7964ec2 100644 --- a/src/modules/m_timedbans.cpp +++ b/src/modules/m_timedbans.cpp @@ -1,6 +1,7 @@ /* * InspIRCd -- Internet Relay Chat Daemon * + * Copyright (C) 2020 iwalkalone * Copyright (C) 2018 linuxdaemon * Copyright (C) 2017 B00mX0r * Copyright (C) 2016, 2019 Matt Schatz diff --git a/vendor/README.md b/vendor/README.md index af7f287dc..c6365eec4 100644 --- a/vendor/README.md +++ b/vendor/README.md @@ -48,7 +48,7 @@ This directory contains vendored dependencies that are shipped with InspIRCd to **License** — Boost Software License -**Version** — v3.1 +**Version** — v3.1.1 **Website** — [https://github.com/nemtrif/utfcpp](https://github.com/nemtrif/utfcpp) diff --git a/vendor/update b/vendor/update index 6f9ff5e86..20a4284bc 100755 --- a/vendor/update +++ b/vendor/update @@ -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** — [%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** — [%s](%s)\n", $website, $website; } -close $fh; \ No newline at end of file +close $fh; diff --git a/vendor/utfcpp/utf8.h b/vendor/utfcpp/utf8.h index c2c85d6d0..82b13f59f 100644 --- a/vendor/utfcpp/utf8.h +++ b/vendor/utfcpp/utf8.h @@ -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 diff --git a/vendor/utfcpp/utf8/checked.h b/vendor/utfcpp/utf8/checked.h index c31861e0a..648636e46 100644 --- a/vendor/utfcpp/utf8/checked.h +++ b/vendor/utfcpp/utf8/checked.h @@ -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 - class iterator : public std::iterator { + 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 diff --git a/vendor/utfcpp/utf8/core.h b/vendor/utfcpp/utf8/core.h index e007ca17d..244e89231 100644 --- a/vendor/utfcpp/utf8/core.h +++ b/vendor/utfcpp/utf8/core.h @@ -30,6 +30,23 @@ DEALINGS IN THE SOFTWARE. #include +// 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 diff --git a/vendor/utfcpp/utf8/unchecked.h b/vendor/utfcpp/utf8/unchecked.h index def000997..0e1b51cc7 100644 --- a/vendor/utfcpp/utf8/unchecked.h +++ b/vendor/utfcpp/utf8/unchecked.h @@ -217,9 +217,14 @@ namespace utf8 // The iterator class template - class iterator : public std::iterator { + 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