From a3673a5a2de9baccd3e0a423de753e65f90717b0 Mon Sep 17 00:00:00 2001 From: Sadie Powell Date: Thu, 1 Oct 2020 10:26:20 +0100 Subject: [PATCH 01/11] Update the changelogs. --- docs/Changes | 9 +++++++++ docs/Changes.conf | 1 + 2 files changed, 10 insertions(+) diff --git a/docs/Changes b/docs/Changes index 3909c1786..f11c2ae8b 100644 --- a/docs/Changes +++ b/docs/Changes @@ -1,5 +1,14 @@ Anope Version 2.0.8-git ------------------- +Add +K channel mode for ircd-hybrid +Add immutable identifiers to user accounts +Fix build on systems that use musl libc +Fix not removing vhosts when an nick is dropped +Fix parsing channel metadata on InspIRCd 3+ +Fix parsing kicks on InspIRCd 3+ +Fix parsing topic changes on InspIRCd 3+ +Fix topiclock on InspIRCd + Anope Version 2.0.7 ------------------- diff --git a/docs/Changes.conf b/docs/Changes.conf index 8d5917b79..0f75fa163 100644 --- a/docs/Changes.conf +++ b/docs/Changes.conf @@ -1,5 +1,6 @@ Anope Version 2.0.8-git ------------------- +Fix ns_register:unconfirmedexpire not being used Anope Version 2.0.7 ------------------- From c29b72fcdc4895ffeefd710e460ce2b59d8e8af3 Mon Sep 17 00:00:00 2001 From: Sadie Powell Date: Fri, 2 Oct 2020 13:22:04 +0100 Subject: [PATCH 02/11] Add C++98 and C++14 build matrixes to the Linux CI. --- .github/workflows/ci-linux.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.github/workflows/ci-linux.yml b/.github/workflows/ci-linux.yml index c0c240ee8..00c99561e 100644 --- a/.github/workflows/ci-linux.yml +++ b/.github/workflows/ci-linux.yml @@ -7,6 +7,7 @@ jobs: runs-on: ubuntu-20.04 env: CXX: ${{ matrix.compiler }} + CXXFLAGS: -std=${{ matrix.standard }} steps: - uses: actions/checkout@v2 - name: Install dependencies @@ -45,3 +46,6 @@ jobs: compiler: - clang++ - g++ + standard: + - c++98 + - c++14 From 1ac3b38fa80cad7b21108ad03ef4aecce34384d0 Mon Sep 17 00:00:00 2001 From: miwob Date: Fri, 2 Oct 2020 13:12:28 +0200 Subject: [PATCH 03/11] Update/modernize ircd-hybrid protocol module to stay link compatible with next ircd-hybrid release --- docs/README | 2 +- modules/protocol/hybrid.cpp | 165 ++++++++++++++---------------------- 2 files changed, 66 insertions(+), 101 deletions(-) diff --git a/docs/README b/docs/README index a33a74a54..39012b635 100644 --- a/docs/README +++ b/docs/README @@ -168,7 +168,7 @@ Table of Contents * Bahamut 1.4.27 or later (including 1.8) * Charybdis 3.4 or later - * Hybrid 8.2 or later + * ircd-hybrid 8.2.23 or later * InspIRCd 1.2 or later * ngIRCd 19.2 or later * Plexus 3 or later diff --git a/modules/protocol/hybrid.cpp b/modules/protocol/hybrid.cpp index 0081125d3..d3de6053a 100644 --- a/modules/protocol/hybrid.cpp +++ b/modules/protocol/hybrid.cpp @@ -1,7 +1,7 @@ -/* ircd-hybrid-8 protocol module +/* ircd-hybrid protocol module. Minimum supported version of ircd-hybrid is 8.2.23. * * (C) 2003-2020 Anope Team - * (C) 2012-2018 ircd-hybrid development team + * (C) 2012-2020 ircd-hybrid development team * * Please read COPYING and README for further details. * @@ -12,23 +12,10 @@ #include "module.h" static Anope::string UplinkSID; +static bool UseSVSAccount = false; // Temporary backwards compatibility hack until old proto is deprecated class HybridProto : public IRCDProto { - BotInfo *FindIntroduced() - { - BotInfo *bi = Config->GetClient("OperServ"); - - if (bi && bi->introduced) - return bi; - - for (botinfo_map::iterator it = BotListByNick->begin(), it_end = BotListByNick->end(); it != it_end; ++it) - if (it->second->introduced) - return it->second; - - return NULL; - } - void SendSVSKillInternal(const MessageSource &source, User *u, const Anope::string &buf) anope_override { IRCDProto::SendSVSKillInternal(source, u, buf); @@ -36,7 +23,7 @@ class HybridProto : public IRCDProto } public: - HybridProto(Module *creator) : IRCDProto(creator, "ircd-hybrid 8.2.x") + HybridProto(Module *creator) : IRCDProto(creator, "ircd-hybrid 8.2.23+") { DefaultPseudoclientModes = "+oi"; CanSVSNick = true; @@ -69,22 +56,22 @@ class HybridProto : public IRCDProto void SendSQLine(User *, const XLine *x) anope_override { - UplinkSocket::Message(FindIntroduced()) << "RESV * " << (x->expires ? x->expires - Anope::CurTime : 0) << " " << x->mask << " :" << x->reason; + UplinkSocket::Message(Me) << "RESV * " << (x->expires ? x->expires - Anope::CurTime : 0) << " " << x->mask << " :" << x->reason; } void SendSGLineDel(const XLine *x) anope_override { - UplinkSocket::Message(Config->GetClient("OperServ")) << "UNXLINE * " << x->mask; + UplinkSocket::Message(Me) << "UNXLINE * " << x->mask; } void SendSGLine(User *, const XLine *x) anope_override { - UplinkSocket::Message(Config->GetClient("OperServ")) << "XLINE * " << x->mask << " " << (x->expires ? x->expires - Anope::CurTime : 0) << " :" << x->GetReason(); + UplinkSocket::Message(Me) << "XLINE * " << x->mask << " " << (x->expires ? x->expires - Anope::CurTime : 0) << " :" << x->GetReason(); } void SendSZLineDel(const XLine *x) anope_override { - UplinkSocket::Message(Config->GetClient("OperServ")) << "UNDLINE * " << x->GetHost(); + UplinkSocket::Message(Me) << "UNDLINE * " << x->GetHost(); } void SendSZLine(User *, const XLine *x) anope_override @@ -95,7 +82,7 @@ class HybridProto : public IRCDProto if (timeleft > 172800 || !x->expires) timeleft = 172800; - UplinkSocket::Message(Config->GetClient("OperServ")) << "DLINE * " << timeleft << " " << x->GetHost() << " :" << x->GetReason(); + UplinkSocket::Message(Me) << "DLINE * " << timeleft << " " << x->GetHost() << " :" << x->GetReason(); } void SendAkillDel(const XLine *x) anope_override @@ -103,12 +90,12 @@ class HybridProto : public IRCDProto if (x->IsRegex() || x->HasNickOrReal()) return; - UplinkSocket::Message(Config->GetClient("OperServ")) << "UNKLINE * " << x->GetUser() << " " << x->GetHost(); + UplinkSocket::Message(Me) << "UNKLINE * " << x->GetUser() << " " << x->GetHost(); } void SendSQLineDel(const XLine *x) anope_override { - UplinkSocket::Message(Config->GetClient("OperServ")) << "UNRESV * " << x->mask; + UplinkSocket::Message(Me) << "UNRESV * " << x->mask; } void SendJoin(User *u, Channel *c, const ChannelStatus *status) anope_override @@ -117,8 +104,8 @@ class HybridProto : public IRCDProto * Note that we must send our modes with the SJOIN and can not add them to the * mode stacker because ircd-hybrid does not allow *any* client to op itself */ - UplinkSocket::Message() << "SJOIN " << c->creation_time << " " << c->name << " +" << c->GetModes(true, true) << " :" - << (status != NULL ? status->BuildModePrefixList() : "") << u->GetUID(); + UplinkSocket::Message(Me) << "SJOIN " << c->creation_time << " " << c->name << " +" << c->GetModes(true, true) << " :" + << (status != NULL ? status->BuildModePrefixList() : "") << u->GetUID(); /* And update our internal status for this user since this is not going through our mode handling system */ if (status) @@ -168,49 +155,43 @@ class HybridProto : public IRCDProto if (timeleft > 172800 || !x->expires) timeleft = 172800; - UplinkSocket::Message(Config->GetClient("OperServ")) << "KLINE * " << timeleft << " " << x->GetUser() << " " << x->GetHost() << " :" << x->GetReason(); + UplinkSocket::Message(Me) << "KLINE * " << timeleft << " " << x->GetUser() << " " << x->GetHost() << " :" << x->GetReason(); } void SendServer(const Server *server) anope_override { if (server == Me) - UplinkSocket::Message() << "SERVER " << server->GetName() << " " << server->GetHops() + 1 << " :" << server->GetDescription(); + UplinkSocket::Message() << "SERVER " << server->GetName() << " " << server->GetHops() + 1 << " " << server->GetSID() << " +" << " :" << server->GetDescription(); else - UplinkSocket::Message(Me) << "SID " << server->GetName() << " " << server->GetHops() + 1 << " " << server->GetSID() << " :" << server->GetDescription(); + UplinkSocket::Message(Me) << "SID " << server->GetName() << " " << server->GetHops() + 1 << " " << server->GetSID() << " +" << " :" << server->GetDescription(); } void SendConnect() anope_override { - UplinkSocket::Message() << "PASS " << Config->Uplinks[Anope::CurrentUplink].password << " TS 6 :" << Me->GetSID(); + UplinkSocket::Message() << "PASS " << Config->Uplinks[Anope::CurrentUplink].password; /* - * As of March 23, 2018, ircd-hybrid-8 does support the following capabilities + * As of October 02, 2020, ircd-hybrid-8 does support the following capabilities * which are required to work with IRC-services: * - * QS - Can handle quit storm removal * TBURST - Supports topic burst * ENCAP - Supports ENCAP - * SVS - Supports services * EOB - Supports End Of Burst message * RHOST - Supports UID message with realhost information */ - UplinkSocket::Message() << "CAPAB :QS ENCAP TBURST SVS EOB RHOST"; + UplinkSocket::Message() << "CAPAB :ENCAP TBURST EOB RHOST"; SendServer(Me); - UplinkSocket::Message() << "SVINFO 6 6 0 :" << Anope::CurTime; + UplinkSocket::Message(Me) << "SVINFO 6 6 0 :" << Anope::CurTime; } void SendClientIntroduction(User *u) anope_override { Anope::string modes = "+" + u->GetModes(); - if (Servers::Capab.count("RHOST")) - UplinkSocket::Message(Me) << "UID " << u->nick << " 1 " << u->timestamp << " " << modes << " " << u->GetIdent() << " " - << u->host << " " << u->host << " 0.0.0.0 " << u->GetUID() << " * :" << u->realname; - else - UplinkSocket::Message(Me) << "UID " << u->nick << " 1 " << u->timestamp << " " << modes << " " << u->GetIdent() << " " - << u->host << " 0.0.0.0 " << u->GetUID() << " * :" << u->realname; + UplinkSocket::Message(Me) << "UID " << u->nick << " 1 " << u->timestamp << " " << modes << " " << u->GetIdent() << " " + << u->host << " " << u->host << " 0.0.0.0 " << u->GetUID() << " * :" << u->realname; } void SendEOB() anope_override @@ -225,12 +206,18 @@ class HybridProto : public IRCDProto void SendLogin(User *u, NickAlias *na) anope_override { - IRCD->SendMode(Config->GetClient("NickServ"), u, "+d %s", na->nc->display.c_str()); + if (UseSVSAccount == false) + IRCD->SendMode(Config->GetClient("NickServ"), u, "+d %s", na->nc->display.c_str()); + else + UplinkSocket::Message(Me) << "SVSACCOUNT " << u->GetUID() << " " << u->timestamp << " " << na->nc->display; } void SendLogout(User *u) anope_override { - IRCD->SendMode(Config->GetClient("NickServ"), u, "+d *"); + if (UseSVSAccount == false) + IRCD->SendMode(Config->GetClient("NickServ"), u, "+d *"); + else + UplinkSocket::Message(Me) << "SVSACCOUNT " << u->GetUID() << " " << u->timestamp << " *"; } void SendChannel(Channel *c) anope_override @@ -240,7 +227,7 @@ class HybridProto : public IRCDProto if (modes.empty()) modes = "+"; - UplinkSocket::Message() << "SJOIN " << c->creation_time << " " << c->name << " " << modes << " :"; + UplinkSocket::Message(Me) << "SJOIN " << c->creation_time << " " << c->name << " " << modes << " :"; } void SendTopic(const MessageSource &source, Channel *c) anope_override @@ -250,10 +237,7 @@ class HybridProto : public IRCDProto void SendForceNickChange(User *u, const Anope::string &newnick, time_t when) anope_override { - if (Servers::Capab.count("RHOST")) - UplinkSocket::Message(Me) << "SVSNICK " << u->GetUID() << " " << u->timestamp << " " << newnick << " " << when; - else - UplinkSocket::Message(Me) << "SVSNICK " << u->GetUID() << " " << newnick << " " << when; + UplinkSocket::Message(Me) << "SVSNICK " << u->GetUID() << " " << u->timestamp << " " << newnick << " " << when; } void SendSVSJoin(const MessageSource &source, User *u, const Anope::string &chan, const Anope::string &) anope_override @@ -281,23 +265,14 @@ class HybridProto : public IRCDProto this->SendSQLineDel(&x); } - void SendVhost(User *u, const Anope::string &ident, const Anope::string &host) anope_override { - if (Servers::Capab.count("RHOST")) - UplinkSocket::Message(Me) << "SVSHOST " << u->GetUID() << " " << u->timestamp << " " << host; - else - /* Note: the +x doesn't set any mode on the ircd-hybrid side */ - UplinkSocket::Message(Me) << "SVSMODE " << u->GetUID() << " " << u->timestamp << " " << "+x " << host; + UplinkSocket::Message(Me) << "SVSHOST " << u->GetUID() << " " << u->timestamp << " " << host; } void SendVhostDel(User *u) anope_override { - if (Servers::Capab.count("RHOST")) - UplinkSocket::Message(Me) << "SVSHOST " << u->GetUID() << " " << u->timestamp << " " << u->host; - else - /* Note: the +x doesn't set any mode on the ircd-hybrid side */ - UplinkSocket::Message(Me) << "SVSMODE " << u->GetUID() << " " << u->timestamp << " " << "+x " << u->host; + UplinkSocket::Message(Me) << "SVSHOST " << u->GetUID() << " " << u->timestamp << " " << u->host; } bool IsIdentValid(const Anope::string &ident) anope_override @@ -348,7 +323,7 @@ struct IRCDMessageBMask : IRCDMessage struct IRCDMessageEOB : IRCDMessage { - IRCDMessageEOB(Module *craetor) : IRCDMessage(craetor, "EOB", 0) { SetFlag(IRCDMESSAGE_REQUIRE_SERVER); } + IRCDMessageEOB(Module *creator) : IRCDMessage(creator, "EOB", 0) { SetFlag(IRCDMESSAGE_REQUIRE_SERVER); } void Run(MessageSource &source, const std::vector ¶ms) anope_override { @@ -386,19 +361,20 @@ struct IRCDMessageNick : IRCDMessage struct IRCDMessagePass : IRCDMessage { - IRCDMessagePass(Module *creator) : IRCDMessage(creator, "PASS", 4) { SetFlag(IRCDMESSAGE_REQUIRE_SERVER); } + IRCDMessagePass(Module *creator) : IRCDMessage(creator, "PASS", 1) { SetFlag(IRCDMESSAGE_REQUIRE_SERVER); SetFlag(IRCDMESSAGE_SOFT_LIMIT); } - /* 0 1 2 3 */ - /* PASS password TS 6 0MC */ + /* 0 */ + /* PASS password */ void Run(MessageSource &source, const std::vector ¶ms) anope_override { - UplinkSID = params[3]; + if (params.size() == 4) + UplinkSID = params[3]; } }; struct IRCDMessagePong : IRCDMessage { - IRCDMessagePong(Module *creator) : IRCDMessage(creator, "PONG", 0) { SetFlag(IRCDMESSAGE_SOFT_LIMIT); SetFlag(IRCDMESSAGE_REQUIRE_SERVER); } + IRCDMessagePong(Module *creator) : IRCDMessage(creator, "PONG", 0) { SetFlag(IRCDMESSAGE_REQUIRE_SERVER); SetFlag(IRCDMESSAGE_SOFT_LIMIT); } void Run(MessageSource &source, const std::vector ¶ms) anope_override { @@ -408,17 +384,23 @@ struct IRCDMessagePong : IRCDMessage struct IRCDMessageServer : IRCDMessage { - IRCDMessageServer(Module *creator) : IRCDMessage(creator, "SERVER", 3) { SetFlag(IRCDMESSAGE_REQUIRE_SERVER); } + IRCDMessageServer(Module *creator) : IRCDMessage(creator, "SERVER", 3) { SetFlag(IRCDMESSAGE_REQUIRE_SERVER); SetFlag(IRCDMESSAGE_SOFT_LIMIT); } - /* 0 1 2 */ - /* SERVER hades.arpa 1 :ircd-hybrid test server */ + /* 0 1 2 3 4 */ + /* SERVER hades.arpa 1 4XY + :ircd-hybrid test server */ void Run(MessageSource &source, const std::vector ¶ms) anope_override { /* Servers other than our immediate uplink are introduced via SID */ if (params[1] != "1") return; - new Server(source.GetServer() == NULL ? Me : source.GetServer(), params[0], 1, params[2], UplinkSID); + if (params.size() == 5) + { + UplinkSID = params[2]; + UseSVSAccount = true; + } + + new Server(source.GetServer() == NULL ? Me : source.GetServer(), params[0], 1, params.back(), UplinkSID); IRCD->SendPing(Me->GetName(), params[0]); } @@ -426,14 +408,14 @@ struct IRCDMessageServer : IRCDMessage struct IRCDMessageSID : IRCDMessage { - IRCDMessageSID(Module *creator) : IRCDMessage(creator, "SID", 4) { SetFlag(IRCDMESSAGE_REQUIRE_SERVER); } + IRCDMessageSID(Module *creator) : IRCDMessage(creator, "SID", 4) { SetFlag(IRCDMESSAGE_REQUIRE_SERVER); SetFlag(IRCDMESSAGE_SOFT_LIMIT); } - /* 0 1 2 3 */ - /* :0MC SID hades.arpa 2 4XY :ircd-hybrid test server */ + /* 0 1 2 3 4 */ + /* :0MC SID hades.arpa 2 4XY + :ircd-hybrid test server */ void Run(MessageSource &source, const std::vector ¶ms) anope_override { unsigned int hops = params[1].is_pos_number_only() ? convertTo(params[1]) : 0; - new Server(source.GetServer() == NULL ? Me : source.GetServer(), params[0], hops, params[3], params[2]); + new Server(source.GetServer() == NULL ? Me : source.GetServer(), params[0], hops, params.back(), params[2]); IRCD->SendPing(Me->GetName(), params[0]); } @@ -464,7 +446,7 @@ struct IRCDMessageSJoin : IRCDMessage Message::Join::SJoinUser sju; /* Get prefixes from the nick */ - for (char ch; (ch = ModeManager::GetStatusChar(buf[0]));) + for (char ch; (ch = ModeManager::GetStatusChar(buf[0])); ) { buf.erase(buf.begin()); sju.first.AddMode(ch); @@ -493,7 +475,6 @@ struct IRCDMessageSVSMode : IRCDMessage * parv[0] = nickname * parv[1] = TS * parv[2] = mode - * parv[3] = optional argument (services id) */ void Run(MessageSource &source, const std::vector ¶ms) anope_override { @@ -552,37 +533,21 @@ struct IRCDMessageTMode : IRCDMessage struct IRCDMessageUID : IRCDMessage { - IRCDMessageUID(Module *creator) : IRCDMessage(creator, "UID", 10) { SetFlag(IRCDMESSAGE_SOFT_LIMIT); SetFlag(IRCDMESSAGE_REQUIRE_SERVER); } + IRCDMessageUID(Module *creator) : IRCDMessage(creator, "UID", 10) { SetFlag(IRCDMESSAGE_REQUIRE_SERVER); SetFlag(IRCDMESSAGE_SOFT_LIMIT); } void Run(MessageSource &source, const std::vector ¶ms) anope_override { NickAlias *na = NULL; - if (params.size() == 11) - { - /* CAPAB RHOST */ - /* 0 1 2 3 4 5 6 7 8 9 10 */ - /* :0MC UID Steve 1 1350157102 +oi ~steve virtual.host real.host 10.0.0.1 0MCAAAAAB Steve :Mining all the time */ - if (params[9] != "*") - na = NickAlias::Find(params[9]); + /* 0 1 2 3 4 5 6 7 8 9 10 */ + /* :0MC UID Steve 1 1350157102 +oi ~steve virtual.host real.host 10.0.0.1 0MCAAAAAB Steve :Mining all the time */ + if (params[9] != "*") + na = NickAlias::Find(params[9]); - /* Source is always the server */ - User::OnIntroduce(params[0], params[4], params[6], params[5], params[7], source.GetServer(), params[10], - params[2].is_pos_number_only() ? convertTo(params[2]) : 0, - params[3], params[8], na ? *na->nc : NULL); - } - else - { - /* 0 1 2 3 4 5 6 7 8 9 */ - /* :0MC UID Steve 1 1350157102 +oi ~steve resolved.host 10.0.0.1 0MCAAAAAB Steve :Mining all the time */ - if (params[8] != "*") - na = NickAlias::Find(params[8]); - - /* Source is always the server */ - User::OnIntroduce(params[0], params[4], params[5], "", params[6], source.GetServer(), params[9], - params[2].is_pos_number_only() ? convertTo(params[2]) : 0, - params[3], params[7], na ? *na->nc : NULL); - } + /* Source is always the server */ + User::OnIntroduce(params[0], params[4], params[6], params[5], params[7], source.GetServer(), params[10], + params[2].is_pos_number_only() ? convertTo(params[2]) : 0, + params[3], params[8], na ? *na->nc : NULL); } }; From da08dd6d0e8d7c895eee42768a8cb9d80830de25 Mon Sep 17 00:00:00 2001 From: miwob Date: Fri, 2 Oct 2020 17:41:12 +0200 Subject: [PATCH 04/11] Minor spelling fix in operserv.example.conf. it's vs its --- data/operserv.example.conf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/data/operserv.example.conf b/data/operserv.example.conf index 51a07bdbe..73c0d500a 100644 --- a/data/operserv.example.conf +++ b/data/operserv.example.conf @@ -544,7 +544,7 @@ command { service = "OperServ"; name = "RELOAD"; command = "operserv/reload"; pe * * This module enables session limiting. Session limiting prevents users from connecting more than a certain * number of times from the same IP at the same time - thus preventing most types of cloning. - * Once a host reaches it's session limit, all clients attempting to connect from that host will + * Once a host reaches its session limit, all clients attempting to connect from that host will * be killed. Exceptions to the default session limit can be defined via the exception list. * * Used to manage the session limit exception list, and view currently active sessions. From 4ba871c631d5362cba1bf90c3fecc03d0f0bc484 Mon Sep 17 00:00:00 2001 From: Sadie Powell Date: Fri, 2 Oct 2020 15:27:47 +0100 Subject: [PATCH 05/11] Remove use of the deprecated register keyword. Fixes a build error on C++17 compilers. --- .github/workflows/ci-linux.yml | 2 +- src/hashcomp.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci-linux.yml b/.github/workflows/ci-linux.yml index 00c99561e..62e0cbb4e 100644 --- a/.github/workflows/ci-linux.yml +++ b/.github/workflows/ci-linux.yml @@ -48,4 +48,4 @@ jobs: - g++ standard: - c++98 - - c++14 + - c++17 diff --git a/src/hashcomp.cpp b/src/hashcomp.cpp index d88a23142..7eac1205a 100644 --- a/src/hashcomp.cpp +++ b/src/hashcomp.cpp @@ -63,7 +63,7 @@ int ci::ci_char_traits::compare(const char *str1, const char *str2, size_t n) { for (unsigned i = 0; i < n; ++i) { - register unsigned char c1 = case_map_upper[static_cast(*str1)], + unsigned char c1 = case_map_upper[static_cast(*str1)], c2 = case_map_upper[static_cast(*str2)]; if (c1 > c2) From af8056d2ddf1822ac2a811f8009989cbf91f4f54 Mon Sep 17 00:00:00 2001 From: Sadie Powell Date: Tue, 6 Oct 2020 14:52:21 +0100 Subject: [PATCH 06/11] Simplify the definition of _le64toh in the siphash implementation. --- src/siphash.cpp | 60 ++++++++++++++++++++++++++++++------------------- 1 file changed, 37 insertions(+), 23 deletions(-) diff --git a/src/siphash.cpp b/src/siphash.cpp index abe6b53bf..796624978 100644 --- a/src/siphash.cpp +++ b/src/siphash.cpp @@ -38,33 +38,47 @@ #include "services.h" #include "anope.h" -#if defined(__BYTE_ORDER__) && defined(__ORDER_LITTLE_ENDIAN__) && \ - __BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__ -# define _le64toh(x) ((uint64_t)(x)) -#elif defined(_WIN32) -/* Windows is always little endian, unless you're on xbox360 - http://msdn.microsoft.com/en-us/library/b0084kay(v=vs.80).aspx */ -# define _le64toh(x) ((uint64_t)(x)) -#elif defined(__APPLE__) +// WARNING: This ifdef maze could be a lot simpler but unfortunately +// that will cause find_includes to be unable to parse it. + +#ifdef __APPLE__ # include # define _le64toh(x) OSSwapLittleToHostInt64(x) -#else - -/* See: http://sourceforge.net/p/predef/wiki/Endianness/ */ -# if defined(__FreeBSD__) || defined(__NetBSD__) || defined(__OpenBSD__) -# include -# else -# include -# endif -# if defined(__BYTE_ORDER) && defined(__LITTLE_ENDIAN) && \ - __BYTE_ORDER == __LITTLE_ENDIAN -# define _le64toh(x) ((uint64_t)(x)) -# else -# define _le64toh(x) le64toh(x) -# endif - #endif +#ifdef __FreeBSD__ +# include +# define _le64toh(x) le64toh(x) +#endif + +#ifdef __linux__ +# include +#endif + +#ifdef __NetBSD__ +# include +# define _le64toh(x) le64toh(x) +#endif + +#ifdef __OpenBSD__ +# include +# define _le64toh(x) le64toh(x) +#endif + +// Windows is always little endian. +#ifdef _WIN32 +# define _le64toh(x) ((uint64_t)(x)) +#endif + +// Attempt to work on unenumerated platforms. +#if defined(le64toh) && !defined(__le64toh) +# define _le64toh le64toh +#endif + +// We can't do anything about this. +#ifndef _le64toh +# error Please define _le64toh for your platform! +#endif #define ROTATE(x, b) (uint64_t)( ((x) << (b)) | ( (x) >> (64 - (b))) ) From d0e839244593fb827d6eb0e4510470d978279497 Mon Sep 17 00:00:00 2001 From: Sadie Powell Date: Tue, 6 Oct 2020 15:13:14 +0100 Subject: [PATCH 07/11] Fix the global/global command showing the wrong origin nick. --- include/modules/pseudoclients/global.h | 3 +++ modules/commands/gl_global.cpp | 8 +++++++- modules/pseudoclients/global.cpp | 5 +++++ 3 files changed, 15 insertions(+), 1 deletion(-) diff --git a/include/modules/pseudoclients/global.h b/include/modules/pseudoclients/global.h index 53e112468..88f878607 100644 --- a/include/modules/pseudoclients/global.h +++ b/include/modules/pseudoclients/global.h @@ -16,6 +16,9 @@ class GlobalService : public Service { } + /** Retrieves the bot which sends global messages unless otherwise specified. */ + virtual Reference GetDefaultSender() = 0; + /** Send out a global message to all users * @param sender Our client which should send the global * @param source The sender of the global diff --git a/modules/commands/gl_global.cpp b/modules/commands/gl_global.cpp index 061649d32..a79caf730 100644 --- a/modules/commands/gl_global.cpp +++ b/modules/commands/gl_global.cpp @@ -37,10 +37,16 @@ class CommandGLGlobal : public Command bool OnHelp(CommandSource &source, const Anope::string &subcommand) anope_override { + Reference sender; + if (GService) + sender = GService->GetDefaultSender(); + if (!sender) + sender = source.service; + this->SendSyntax(source); source.Reply(" "); source.Reply(_("Allows Administrators to send messages to all users on the\n" - "network. The message will be sent from the nick \002%s\002."), source.service->nick.c_str()); + "network. The message will be sent from the nick \002%s\002."), sender->nick.c_str()); return true; } }; diff --git a/modules/pseudoclients/global.cpp b/modules/pseudoclients/global.cpp index 6810e7ef1..495d31ba4 100644 --- a/modules/pseudoclients/global.cpp +++ b/modules/pseudoclients/global.cpp @@ -29,6 +29,11 @@ class GlobalCore : public Module, public GlobalService { } + Reference GetDefaultSender() anope_override + { + return Global; + } + void SendGlobal(BotInfo *sender, const Anope::string &source, const Anope::string &message) anope_override { if (Me->GetLinks().empty()) From a79046e025594188a1c222da653f4a9266a9a074 Mon Sep 17 00:00:00 2001 From: TheMythPT Date: Sat, 9 Feb 2019 16:45:25 +0100 Subject: [PATCH 08/11] Update nickserv.example.conf This breaks the `killprotect' functionality, because a user is expected to turn into guest after the specified amount of time. Also new users that register their nicknames will wonder why they can't join a +R channel but they didn't change their nick to Guest* --- data/nickserv.example.conf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/data/nickserv.example.conf b/data/nickserv.example.conf index 7f864ccf9..83fde7878 100644 --- a/data/nickserv.example.conf +++ b/data/nickserv.example.conf @@ -262,7 +262,7 @@ module * being recognized, unless they manually add an address to the access list of their account. * This directive is optional. */ - addaccessonreg = yes + addaccessonreg = no } command { service = "NickServ"; name = "ACCESS"; command = "nickserv/access"; } From f8777097d13f3eb47284c32fceb44e8db20491c2 Mon Sep 17 00:00:00 2001 From: Sadie Powell Date: Wed, 7 Oct 2020 12:46:37 +0100 Subject: [PATCH 09/11] Fix last case check for le64toh. --- src/siphash.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/siphash.cpp b/src/siphash.cpp index 796624978..03b042cb6 100644 --- a/src/siphash.cpp +++ b/src/siphash.cpp @@ -71,7 +71,7 @@ #endif // Attempt to work on unenumerated platforms. -#if defined(le64toh) && !defined(__le64toh) +#if defined(le64toh) && !defined(_le64toh) # define _le64toh le64toh #endif From 6117299ecd93226622ca2f4319910d61da23972a Mon Sep 17 00:00:00 2001 From: Sadie Powell Date: Wed, 7 Oct 2020 12:52:36 +0100 Subject: [PATCH 10/11] Update the changelog. --- docs/Changes | 2 ++ 1 file changed, 2 insertions(+) diff --git a/docs/Changes b/docs/Changes index f11c2ae8b..df8e02b21 100644 --- a/docs/Changes +++ b/docs/Changes @@ -3,11 +3,13 @@ Anope Version 2.0.8-git Add +K channel mode for ircd-hybrid Add immutable identifiers to user accounts Fix build on systems that use musl libc +Fix help of global/global not showing the correct origin nick Fix not removing vhosts when an nick is dropped Fix parsing channel metadata on InspIRCd 3+ Fix parsing kicks on InspIRCd 3+ Fix parsing topic changes on InspIRCd 3+ Fix topiclock on InspIRCd +Modernize the ircd-hybrid protocol module Anope Version 2.0.7 From 46e1395e62ad4d9a028b51f72d8d6a92187cf9b9 Mon Sep 17 00:00:00 2001 From: Sadie Powell Date: Wed, 7 Oct 2020 12:58:00 +0100 Subject: [PATCH 11/11] Release 2.0.8. --- docs/Changes | 2 +- docs/Changes.conf | 2 +- src/version.sh | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/docs/Changes b/docs/Changes index df8e02b21..15f4b5b16 100644 --- a/docs/Changes +++ b/docs/Changes @@ -1,4 +1,4 @@ -Anope Version 2.0.8-git +Anope Version 2.0.8 ------------------- Add +K channel mode for ircd-hybrid Add immutable identifiers to user accounts diff --git a/docs/Changes.conf b/docs/Changes.conf index 0f75fa163..4ba740374 100644 --- a/docs/Changes.conf +++ b/docs/Changes.conf @@ -1,4 +1,4 @@ -Anope Version 2.0.8-git +Anope Version 2.0.8 ------------------- Fix ns_register:unconfirmedexpire not being used diff --git a/src/version.sh b/src/version.sh index 7c2ca8ad1..9458e1220 100644 --- a/src/version.sh +++ b/src/version.sh @@ -3,4 +3,4 @@ VERSION_MAJOR=2 VERSION_MINOR=0 VERSION_PATCH=8 -VERSION_EXTRA="-git" +VERSION_EXTRA=""