Merge branch 'insp3' into master.

This commit is contained in:
Sadie Powell 2021-12-11 09:26:34 +00:00
commit 7007dd76e6
9 changed files with 210 additions and 34 deletions

View File

@ -22,6 +22,7 @@ Daniel Vassdal <shutter@canternet.org> ShutterQuick <shutter@canternet.org
Dennis Friis <peavey@inspircd.org> peavey <peavey@e03df62e-2008-0410-955e-edbf42e46eb7>
DjSlash <djslash@djslash.org> Rutger <djslash+github@djslash.org>
Geoff Bricker <geoff.bricker@gmail.com> bricker <bricker@e03df62e-2008-0410-955e-edbf42e46eb7>
Herman <GermanAizek@yandex.ru> GermanAizek <GermanAizek@yandex.ru>
iwalkalone <iwalkalone69@gmail.com> iwalkalone <iwalkalone69@users.noreply.github.com>
jackmcbarn <jackmcbarn@inspircd.org> Jackmcbarn <jackmcbarn@jackmcbarn.no-ip.org>
James Lu <GLolol@overdrivenetworks.com> James Lu <GLolol1@hotmail.com>
@ -40,16 +41,19 @@ Robby <robby@chatbelgie.be> Robby- <robbyke@gmail.com>
Robin Burchell <robin+git@viroteck.net> Robin Burchell <viroteck@viroteck.net>
Robin Burchell <robin+git@viroteck.net> w00t <w00t@e03df62e-2008-0410-955e-edbf42e46eb7>
Sadie Powell <sadie@witchery.services> Peter Powell <petpow@saberuk.com>
satmd <satmd@satmd.de> satmd <satmd@lain.at>
satmd <satmd@satmd.de> satmd <satmd@users.noreply.github.com>
Thomas Stagner <aquanight@inspircd.org> aquanight <aquanight@e03df62e-2008-0410-955e-edbf42e46eb7>
Uli Schlachter <psychon@inspircd.org> psychon <psychon@e03df62e-2008-0410-955e-edbf42e46eb7>
# The identities of the following people could not be verified:
#
# burlex <burlex@e03df62e-2008-0410-955e-edbf42e46eb7>
# eggy <eggy@e03df62e-2008-0410-955e-edbf42e46eb7>
# fez <fez@e03df62e-2008-0410-955e-edbf42e46eb7>
# jamie <jamie@e03df62e-2008-0410-955e-edbf42e46eb7>
# katsklaw <katsklaw@e03df62e-2008-0410-955e-edbf42e46eb7>
# Philouuu <philsliders@laptop.(none)> / PhilSliderS <philsliders@laptop.(none)>
# randomdan <randomdan@e03df62e-2008-0410-955e-edbf42e46eb7>
# typobox43 <typobox43@e03df62e-2008-0410-955e-edbf42e46eb7>
# The identities of the following people could not be verified. If you have an
# email address for them please contact Sadie.
burlex <unknown@email.invalid> burlex <burlex@e03df62e-2008-0410-955e-edbf42e46eb7>
eggy <unknown@email.invalid> eggy <eggy@e03df62e-2008-0410-955e-edbf42e46eb7>
fez <unknown@email.invalid> fez <fez@e03df62e-2008-0410-955e-edbf42e46eb7>
jamie <unknown@email.invalid> jamie <jamie@e03df62e-2008-0410-955e-edbf42e46eb7>
katsklaw <unknown@email.invalid> katsklaw <katsklaw@e03df62e-2008-0410-955e-edbf42e46eb7>
PhilSliderS <unknown@email.invalid> Philouuu <philsliders@laptop.(none)>
PhilSliderS <unknown@email.invalid> PhilSliderS <philsliders@laptop.(none)>
randomdan <unknown@email.invalid> randomdan <randomdan@e03df62e-2008-0410-955e-edbf42e46eb7>
typobox43 <unknown@email.invalid> typobox43 <typobox43@e03df62e-2008-0410-955e-edbf42e46eb7>

106
docs/AUTHORS.txt Normal file
View File

@ -0,0 +1,106 @@
Since the first commit in January 2003 102 people have submitted patches,
commits, and other useful contributions to InspIRCd. These people, ordered by
the number of contributions they have made, are:
* Craig Edwards <brain@inspircd.org>
* Attila Molnar <attilamolnar@hush.com>
* Sadie Powell <sadie@witchery.services>
* Robin Burchell <robin+git@viroteck.net>
* Daniel De Graaf <danieldg@inspircd.org>
* Dennis Friis <peavey@inspircd.org>
* Oliver Lupton <om@inspircd.org>
* John Brooks <special@inspircd.org>
* Adam <Adam@anope.org>
* Craig McLure <craig@frostycoolslug.com>
* Matt Schatz <genius3000@g3k.solutions>
* Thomas Stagner <aquanight@inspircd.org>
* Robby <robby@chatbelgie.be>
* Daniel Vassdal <shutter@canternet.org>
* Matt Smith <dz@inspircd.org>
* Geoff Bricker <geoff.bricker@gmail.com>
* linuxdaemon <linuxdaemon.irc@gmail.com>
* Pippijn van Steenhoven <pip88nl@gmail.com>
* Ariadne Conill <ariadne@dereferenced.org>
* burlex
* jackmcbarn <jackmcbarn@inspircd.org>
* Uli Schlachter <psychon@inspircd.org>
* ChrisTX <xpipe@hotmail.de>
* B00mX0r <b00mx0r@aureus.pw>
* fez
* Shawn Smith <ShawnSmith0828@gmail.com>
* DjSlash <djslash@djslash.org>
* blitmap <blitternet@gmail.com>
* jamie
* Justin Crawford <Justasic@Gmail.com>
* katsklaw
* Dylan Frank <b00mx0r@aureus.pw>
* iwalkalone <iwalkalone69@gmail.com>
* Steven Van Acker <steven@singularity.be>
* Dan Parsons <dparsons@nyip.net>
* Googolplexed <googol@googolplexed.net>
* Mantas Mikulėnas <grawity@gmail.com>
* Renegade334 <contact.caaeed4f@renegade334.me.uk>
* Sheogorath <sheogorath@shivering-isles.com>
* Wade Cline <wadecline@hotmail.com>
* typobox43
* Anatole Denis <natolumin@rezel.net>
* Ben Harris <ben@tilde.team>
* Chin Lee <kwangchin@gmail.com>
* Christopher 'm4z' Holm <them4z@gmail.com>
* Guillaume Delacour <gui@iroqwa.org>
* JD Horelick <jdhore1@gmail.com>
* James Lu <GLolol@overdrivenetworks.com>
* Jens Voss <DukePyrolator@anope.org>
* Johanna A
* Kyle Fuller <inbox@kylefuller.co.uk>
* Michael <michaelhazell@hotmail.com>
* Michael Hazell <michaelhazell@hotmail.com>
* Molly Miller
* PhilSliderS
* Valentin Lorentz <progval+git@progval.net>
* eggy
* md_5 <git@md-5.net>
* satmd <satmd@satmd.de>
* 0x277F <0x277F@gmail.com>
* A_D
* Adrien Bustany <adrien@bustany.org>
* Akinwale Ariwodola <akinwale@gmail.com>
* Alyx <alyx@malkier.net>
* Boleslaw Tokarski <boleslaw.tokarski@tieto.com>
* Chew
* Chris Novakovic
* Christian Höltje <docwhat@gerf.org>
* Christoph Egger <christoph@debian.org>
* Christos Triantafyllidis
* David Lamont <del6597@rit.edu>
* David Schultz <me@zpld.me>
* ElementalAlchemist <ElementAlchemist7@gmail.com>
* Elizabeth Myers <elizabeth@interlinked.me>
* Filippo Cortigiani <simos@simosnap.org>
* Florian Praden <florian@praden.eu>
* Garrett Holmstrom <gholms@fedoraproject.org>
* Herman <GermanAizek@yandex.ru>
* Joel Sing <joel@sing.id.au>
* Jordyn/The Linux Geek <onlinecloud1@gmail.com>
* Josh Soref
* Julien Vehent <julien@linuxwall.info>
* JustArchi <JustArchi@JustArchi.net>
* Matthew Martin <phy1729@gmail.com>
* Pierre Carrier <pierre@spotify.com>
* Puck Meerburg <puck@puckipedia.com>
* R-V6
* Richard Bradfield <bradfirj@fstab.me>
* ThatOneRoadie <thatoneroadie+github@gmail.com>
* The Aviator <aviator45003@gmail.com>
* Thiago Crepaldi <thiago@thiagocrepaldi.com>
* Thomas Fargeix <t.fargeix@gmail.com>
* Tim Heckman <t@heckman.io>
* Vitor Luis <droider.pc@gmail.com>
* WindowsUser
* edef <edef@edef.eu>
* emerson <github@emersonveenstra.net>
* newuser1 <flirtex@gmail.com>
* nia <nia@netbsd.org>
* randomdan
* systocrat <systocrat@outlook.com>

View File

@ -271,7 +271,7 @@ static std::string GetServerHost()
{
std::string name(hostname);
if (name.find('.') == std::string::npos)
name.push_back('.');
name.append(".local");
if (name.length() <= ServerInstance->Config->Limits.MaxHost && InspIRCd::IsHost(name))
return name;

View File

@ -71,7 +71,7 @@ CmdResult CommandKick::Handle(User* user, const Params& parameters)
if (u->server->IsService())
{
user->WriteNumeric(ERR_CHANOPRIVSNEEDED, c->name, "You may not kick a service");
user->WriteNumeric(ERR_RESTRICTED, c->name, "You may not kick a service");
return CmdResult::FAILURE;
}
}

View File

@ -58,10 +58,12 @@ class LDAPRequest
LDAPResult* result = nullptr; /* final result */
struct timeval tv;
QueryType type;
int success;
LDAPRequest(LDAPService* s, LDAPInterface* i)
LDAPRequest(LDAPService* s, LDAPInterface* i, int c)
: service(s)
, inter(i)
, success(c)
{
type = QUERY_UNKNOWN;
tv.tv_sec = 0;
@ -86,7 +88,7 @@ class LDAPBind final
public:
LDAPBind(LDAPService* s, LDAPInterface* i, const std::string& w, const std::string& p)
: LDAPRequest(s, i)
: LDAPRequest(s, i, LDAP_SUCCESS)
, who(w)
, pass(p)
{
@ -106,7 +108,7 @@ class LDAPSearch final
public:
LDAPSearch(LDAPService* s, LDAPInterface* i, const std::string& b, int se, const std::string& f)
: LDAPRequest(s, i)
: LDAPRequest(s, i, LDAP_SUCCESS)
, base(b)
, searchscope(se)
, filter(f)
@ -126,7 +128,7 @@ class LDAPAdd final
public:
LDAPAdd(LDAPService* s, LDAPInterface* i, const std::string& d, const LDAPMods& attr)
: LDAPRequest(s, i)
: LDAPRequest(s, i, LDAP_SUCCESS)
, dn(d)
, attributes(attr)
{
@ -144,7 +146,7 @@ class LDAPDel final
public:
LDAPDel(LDAPService* s, LDAPInterface* i, const std::string& d)
: LDAPRequest(s, i)
: LDAPRequest(s, i, LDAP_SUCCESS)
, dn(d)
{
type = QUERY_DELETE;
@ -162,7 +164,7 @@ class LDAPModify final
public:
LDAPModify(LDAPService* s, LDAPInterface* i, const std::string& b, const LDAPMods& attr)
: LDAPRequest(s, i)
: LDAPRequest(s, i, LDAP_SUCCESS)
, base(b)
, attributes(attr)
{
@ -180,7 +182,7 @@ class LDAPCompare final
public:
LDAPCompare(LDAPService* s, LDAPInterface* i, const std::string& d, const std::string& a, const std::string& v)
: LDAPRequest(s, i)
: LDAPRequest(s, i, LDAP_COMPARE_TRUE)
, dn(d)
, attr(a)
, val(v)
@ -407,7 +409,7 @@ class LDAPService final
LDAPResult* ldap_result = req->result = new LDAPResult();
req->result->type = req->type;
if (res != LDAP_SUCCESS)
if (res != req->success)
{
ldap_result->error = InspIRCd::Format("%s (%s)", ldap_err2string(res), req->info().c_str());
return;

View File

@ -49,7 +49,7 @@ class ModuleNoKicks final
if (!extban.GetStatus(source, memb->chan).check(!modeset))
{
// Can't kick with Q in place, not even opers with override, and founders
source->WriteNumeric(ERR_CHANOPRIVSNEEDED, memb->chan->name, InspIRCd::Format("Can't kick user %s from channel (%s)",
source->WriteNumeric(ERR_RESTRICTED, memb->chan->name, InspIRCd::Format("Can't kick user %s from channel (%s)",
memb->user->nick.c_str(), modeset ? "+Q is set" : "you're extbanned"));
return MOD_RES_DENY;
}

View File

@ -243,22 +243,22 @@ class ModuleShun final
}
}
if (cleanedcommands.count(command))
if (!cleanedcommands.count(command))
return MOD_RES_PASSTHRU;
switch (parameters.size())
{
if (command == "AWAY" && !parameters.empty())
case 0:
{
// Allow away but only for unsetting.
parameters.clear();
if (command == "AWAY" || command == "QUIT")
parameters.clear();
break;
}
else if (command == "PART" && parameters.size() > 1)
case 1:
{
// Allow part but strip the message.
parameters.pop_back();
}
else if (command == "QUIT" && !parameters.empty())
{
// Allow quit but strip the message.
parameters.clear();
if (command == "CYCLE" || command == "KNOCK" || command == "PART")
parameters.resize(1);
break;
}
}

59
tools/mkauthors Executable file
View File

@ -0,0 +1,59 @@
#!/usr/bin/env perl
#
# InspIRCd -- Internet Relay Chat Daemon
#
# Copyright (C) 2021 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
# 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/>.
#
use v5.26.0;
use strict;
use warnings FATAL => qw(all);
use File::Basename qw(dirname);
use File::Spec::Functions qw(catfile);
use FindBin qw($RealDir);
use lib dirname $RealDir;
use make::common;
use make::console;
my %authors;
for my $author (split /\n+/, `git log --pretty='%aN <%aE>' HEAD`) {
$author = $1 if $author =~ /^(.+) <(?:unknown\@email.invalid|\S+\@users.noreply.github.com)>$/;
$authors{$author} ||= 0;
$authors{$author} += 1;
}
my $author_file = catfile dirname($RealDir), 'docs', 'AUTHORS.txt';
open(my $fh, '>', $author_file) or print_error "unable to write $author_file: $!";
say $fh <<"EOH";
Since the first commit in January 2003 ${\scalar %authors} people have submitted patches,
commits, and other useful contributions to InspIRCd. These people, ordered by
the number of contributions they have made, are:
EOH
for my $author (sort { $authors{$b} <=> $authors{$a} or $a cmp $b } keys %authors) {
next if $author eq 'InspIRCd Robot <noreply@inspircd.org>';
say $fh " * $author";
}
close $fh;
execute 'git', 'commit',
'--author', 'InspIRCd Robot <noreply@inspircd.org>',
'--message', 'Update author list.',
'--', $author_file;

View File

@ -79,11 +79,16 @@ for my $path (@paths) {
} elsif ($line =~ /^author (.+)/) {
$commits{$commit}->{NAME} = $1;
} elsif ($line =~ /^author-mail <(.+)>/) {
next if $1 eq 'unknown@email.invalid';
next if $1 =~ /\@users.noreply.github.com$/;
$commits{$commit}->{EMAIL} = $1;
} elsif ($line =~ /^author-time (.+)/) {
$commits{$commit}->{YEAR} = strftime '%Y', gmtime $1;
} elsif ($line =~ /^filename /) {
my $display = sprintf "%s <%s>", $commits{$commit}->{NAME}, $commits{$commit}->{EMAIL};
my $display = $commits{$commit}->{NAME};
if (exists $commits{$commit}->{EMAIL}) {
$display .= sprintf " <%s>", $commits{$commit}->{EMAIL};
}
$authors{$display} //= [];
push @{$authors{$display}}, $commits{$commit}->{YEAR};
my $details = `git rev-list --format=%B --max-count=1 $commit`;