diff options
| author | 2025-12-07 20:55:20 +0000 | |
|---|---|---|
| committer | 2025-12-07 20:55:20 +0000 | |
| commit | 79c01cb2a2615fbcb2a568d5a49c6d470459cf45 (patch) | |
| tree | be0f4c84145b8902abec690e5885831a061407f3 /modules | |
| parent | Avoid using deprecated functions in ssl_openssl. (diff) | |
| parent | Release v4.9.0. (diff) | |
Merge branch 'insp4' into master.
Diffstat (limited to 'modules')
35 files changed, 88 insertions, 86 deletions
diff --git a/modules/core/core_channel/cmd_invite.cpp b/modules/core/core_channel/cmd_invite.cpp index 7289f697b..ec801058a 100644 --- a/modules/core/core_channel/cmd_invite.cpp +++ b/modules/core/core_channel/cmd_invite.cpp @@ -3,7 +3,7 @@ * * Copyright (C) 2018, 2020-2024 Sadie Powell <sadie@witchery.services> * Copyright (C) 2018 linuxdaemon <linuxdaemon.irc@gmail.com> - * Copyright (C) 2017 B00mX0r <b00mx0r@aureus.pw> + * Copyright (C) 2017 Dylan Frank <b00mx0r@aureus.pw> * Copyright (C) 2013-2016, 2018 Attila Molnar <attilamolnar@hush.com> * Copyright (C) 2012 Robby <robby@chatbelgie.be> * Copyright (C) 2009-2010 Daniel De Graaf <danieldg@inspircd.org> diff --git a/modules/core/core_channel/cmd_join.cpp b/modules/core/core_channel/cmd_join.cpp index 0ba9adb29..8644d252f 100644 --- a/modules/core/core_channel/cmd_join.cpp +++ b/modules/core/core_channel/cmd_join.cpp @@ -2,7 +2,7 @@ * InspIRCd -- Internet Relay Chat Daemon * * Copyright (C) 2018, 2020, 2022 Sadie Powell <sadie@witchery.services> - * Copyright (C) 2017 B00mX0r <b00mx0r@aureus.pw> + * Copyright (C) 2017 Dylan Frank <b00mx0r@aureus.pw> * Copyright (C) 2013-2014 Attila Molnar <attilamolnar@hush.com> * Copyright (C) 2012 Robby <robby@chatbelgie.be> * Copyright (C) 2009-2010 Daniel De Graaf <danieldg@inspircd.org> diff --git a/modules/core/core_channel/cmd_kick.cpp b/modules/core/core_channel/cmd_kick.cpp index 94773223c..51aa04f40 100644 --- a/modules/core/core_channel/cmd_kick.cpp +++ b/modules/core/core_channel/cmd_kick.cpp @@ -2,7 +2,7 @@ * InspIRCd -- Internet Relay Chat Daemon * * Copyright (C) 2017-2018, 2020, 2022-2023, 2025 Sadie Powell <sadie@witchery.services> - * Copyright (C) 2017 B00mX0r <b00mx0r@aureus.pw> + * Copyright (C) 2017 Dylan Frank <b00mx0r@aureus.pw> * Copyright (C) 2013-2014, 2016 Attila Molnar <attilamolnar@hush.com> * Copyright (C) 2012 Robby <robby@chatbelgie.be> * Copyright (C) 2009-2010 Daniel De Graaf <danieldg@inspircd.org> diff --git a/modules/core/core_channel/cmd_topic.cpp b/modules/core/core_channel/cmd_topic.cpp index c2a839ea6..126b50503 100644 --- a/modules/core/core_channel/cmd_topic.cpp +++ b/modules/core/core_channel/cmd_topic.cpp @@ -3,7 +3,7 @@ * * Copyright (C) 2019 Matt Schatz <genius3000@g3k.solutions> * Copyright (C) 2017-2018, 2020-2024 Sadie Powell <sadie@witchery.services> - * Copyright (C) 2017 B00mX0r <b00mx0r@aureus.pw> + * Copyright (C) 2017 Dylan Frank <b00mx0r@aureus.pw> * Copyright (C) 2013-2016 Attila Molnar <attilamolnar@hush.com> * Copyright (C) 2012 Robby <robby@chatbelgie.be> * Copyright (C) 2009 Daniel De Graaf <danieldg@inspircd.org> diff --git a/modules/core/core_mode.cpp b/modules/core/core_mode.cpp index 1e144e208..ce7660bf2 100644 --- a/modules/core/core_mode.cpp +++ b/modules/core/core_mode.cpp @@ -5,7 +5,7 @@ * Copyright (C) 2021 Andrio Celos * Copyright (C) 2019 linuxdaemon <linuxdaemon.irc@gmail.com> * Copyright (C) 2018-2024 Sadie Powell <sadie@witchery.services> - * Copyright (C) 2017 B00mX0r <b00mx0r@aureus.pw> + * Copyright (C) 2017 Dylan Frank <b00mx0r@aureus.pw> * Copyright (C) 2014-2016 Attila Molnar <attilamolnar@hush.com> * * This file is part of InspIRCd. InspIRCd is free software: you can diff --git a/modules/core/core_user/cmd_part.cpp b/modules/core/core_user/cmd_part.cpp index f32a983f6..c5ec3c66f 100644 --- a/modules/core/core_user/cmd_part.cpp +++ b/modules/core/core_user/cmd_part.cpp @@ -2,7 +2,7 @@ * InspIRCd -- Internet Relay Chat Daemon * * Copyright (C) 2018, 2020, 2022-2023 Sadie Powell <sadie@witchery.services> - * Copyright (C) 2017 B00mX0r <b00mx0r@aureus.pw> + * Copyright (C) 2017 Dylan Frank <b00mx0r@aureus.pw> * Copyright (C) 2012-2016 Attila Molnar <attilamolnar@hush.com> * Copyright (C) 2012 Robby <robby@chatbelgie.be> * Copyright (C) 2009 Uli Schlachter <psychon@znc.in> diff --git a/modules/cycle.cpp b/modules/cycle.cpp index 12c4dfe9c..8dbff45e6 100644 --- a/modules/cycle.cpp +++ b/modules/cycle.cpp @@ -2,7 +2,7 @@ * InspIRCd -- Internet Relay Chat Daemon * * Copyright (C) 2019-2023 Sadie Powell <sadie@witchery.services> - * Copyright (C) 2017 B00mX0r <b00mx0r@aureus.pw> + * Copyright (C) 2017 Dylan Frank <b00mx0r@aureus.pw> * Copyright (C) 2012-2014, 2016 Attila Molnar <attilamolnar@hush.com> * Copyright (C) 2012 Robby <robby@chatbelgie.be> * Copyright (C) 2010 Craig Edwards <brain@inspircd.org> diff --git a/modules/dccallow.cpp b/modules/dccallow.cpp index 4092c325c..dd71f4a1d 100644 --- a/modules/dccallow.cpp +++ b/modules/dccallow.cpp @@ -130,7 +130,7 @@ public: // Remove the old list and create a new one. Unset(user, false); - auto* list = new dccallowlist(); + dccallowlist* list = nullptr; irc::spacesepstream ts(value); while (!ts.StreamEnd()) @@ -158,36 +158,32 @@ public: } // Store the DCC allow entry. + if (!list) + list = new dccallowlist(); list->push_back(dccallow); } - // If we have an empty list then don't store it. - if (list->empty()) - { - delete list; - return; - } - // The value was well formed. - Set(user, list); + if (list) + Set(user, list); } std::string ToInternal(const Extensible* container, void* item) const noexcept override { - dccallowlist* list = static_cast<dccallowlist*>(item); + auto* list = static_cast<dccallowlist*>(item); std::string buf; - for (dccallowlist::const_iterator iter = list->begin(); iter != list->end(); ++iter) + for (const auto& entry : *list) { - if (iter != list->begin()) + if (!buf.empty()) buf.push_back(' '); - buf.append(iter->nickname); + buf.append(entry.nickname); buf.push_back(' '); - buf.append(iter->hostmask); + buf.append(entry.hostmask); buf.push_back(' '); - buf.append(ConvToStr(iter->set_on)); + buf.append(ConvToStr(entry.set_on)); buf.push_back(' '); - buf.append(ConvToStr(iter->length)); + buf.append(ConvToStr(entry.length)); } return buf; } diff --git a/modules/dnsbl.cpp b/modules/dnsbl.cpp index 83a82a38a..6071a17f4 100644 --- a/modules/dnsbl.cpp +++ b/modules/dnsbl.cpp @@ -428,7 +428,7 @@ public: , data(sd) { access_needed = CmdAccess::OPERATOR; - syntax = { "[<nick> [<reason>]]" }; + syntax = { "<nick> [<reason>]" }; translation = { TR_NICK, TR_TEXT }; } diff --git a/modules/extra/pgsql.cpp b/modules/extra/pgsql.cpp index e605f0144..6ceb7b517 100644 --- a/modules/extra/pgsql.cpp +++ b/modules/extra/pgsql.cpp @@ -411,7 +411,10 @@ restart: case PGRES_BAD_RESPONSE: case PGRES_FATAL_ERROR: { - SQL::Error err(SQL::QREPLY_FAIL, PQresultErrorMessage(result)); + std::string errmsg = PQresultErrorMessage(result); + for (size_t pos = 0; ((pos = errmsg.find_first_of("\r\n", pos)) != std::string::npos); ) + errmsg[pos] = ' '; + SQL::Error err(SQL::QREPLY_FAIL, errmsg); qinprog.c->OnError(err); break; } diff --git a/modules/extra/ssl_gnutls.cpp b/modules/extra/ssl_gnutls.cpp index d3a09b43b..4720c1034 100644 --- a/modules/extra/ssl_gnutls.cpp +++ b/modules/extra/ssl_gnutls.cpp @@ -664,7 +664,7 @@ private: return; } - certinfo->invalid = (certstatus & GNUTLS_CERT_INVALID); + certinfo->invalid = (certstatus & GNUTLS_CERT_SIGNATURE_FAILURE); certinfo->unknownsigner = (certstatus & GNUTLS_CERT_SIGNER_NOT_FOUND); certinfo->revoked = (certstatus & GNUTLS_CERT_REVOKED); certinfo->trusted = !(certstatus & GNUTLS_CERT_SIGNER_NOT_CA); diff --git a/modules/filter.cpp b/modules/filter.cpp index daeb61aaa..24ffbe8f5 100644 --- a/modules/filter.cpp +++ b/modules/filter.cpp @@ -6,7 +6,7 @@ * Copyright (C) 2019 Filippo Cortigiani <simos@simosnap.org> * Copyright (C) 2018-2019 linuxdaemon <linuxdaemon.irc@gmail.com> * Copyright (C) 2018 Michael Hazell <michaelhazell@hotmail.com> - * Copyright (C) 2017 B00mX0r <b00mx0r@aureus.pw> + * Copyright (C) 2017 Dylan Frank <b00mx0r@aureus.pw> * Copyright (C) 2012-2014, 2016 Attila Molnar <attilamolnar@hush.com> * Copyright (C) 2012-2013, 2017-2025 Sadie Powell <sadie@witchery.services> * Copyright (C) 2012, 2018-2019 Robby <robby@chatbelgie.be> diff --git a/modules/ircv3_ctctags.cpp b/modules/ircv3_ctctags.cpp index 0b1904f90..397185e57 100644 --- a/modules/ircv3_ctctags.cpp +++ b/modules/ircv3_ctctags.cpp @@ -2,7 +2,7 @@ * InspIRCd -- Internet Relay Chat Daemon * * Copyright (C) 2019 linuxdaemon <linuxdaemon.irc@gmail.com> - * Copyright (C) 2018-2024 Sadie Powell <sadie@witchery.services> + * Copyright (C) 2018-2025 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 diff --git a/modules/knock.cpp b/modules/knock.cpp index 03058fe32..411a6a981 100644 --- a/modules/knock.cpp +++ b/modules/knock.cpp @@ -1,7 +1,7 @@ /* * InspIRCd -- Internet Relay Chat Daemon * - * Copyright (C) 2017 B00mX0r <b00mx0r@aureus.pw> + * Copyright (C) 2017 Dylan Frank <b00mx0r@aureus.pw> * Copyright (C) 2013, 2018-2024 Sadie Powell <sadie@witchery.services> * Copyright (C) 2012-2013, 2018 Attila Molnar <attilamolnar@hush.com> * Copyright (C) 2012 Robby <robby@chatbelgie.be> diff --git a/modules/messageflood.cpp b/modules/messageflood.cpp index 32f0bed78..cfba1b513 100644 --- a/modules/messageflood.cpp +++ b/modules/messageflood.cpp @@ -1,11 +1,10 @@ /* * InspIRCd -- Internet Relay Chat Daemon * - * Copyright (C) 2017-2024 Sadie Powell <sadie@witchery.services> + * Copyright (C) 2017-2025 Sadie Powell <sadie@witchery.services> * Copyright (C) 2012-2014 Attila Molnar <attilamolnar@hush.com> * Copyright (C) 2012 Robby <robby@chatbelgie.be> * Copyright (C) 2009 Daniel De Graaf <danieldg@inspircd.org> - * Copyright (C) 2008 Robin Burchell <robin+git@viroteck.net> * Copyright (C) 2006, 2008 Craig Edwards <brain@inspircd.org> * * This file is part of InspIRCd. InspIRCd is free software: you can diff --git a/modules/namedmodes.cpp b/modules/namedmodes.cpp index 31a82a1c4..a1245b23a 100644 --- a/modules/namedmodes.cpp +++ b/modules/namedmodes.cpp @@ -3,7 +3,7 @@ * * Copyright (C) 2021 Herman <GermanAizek@yandex.ru> * Copyright (C) 2018-2023 Sadie Powell <sadie@witchery.services> - * Copyright (C) 2017 B00mX0r <b00mx0r@aureus.pw> + * Copyright (C) 2017 Dylan Frank <b00mx0r@aureus.pw> * Copyright (C) 2013-2016 Attila Molnar <attilamolnar@hush.com> * Copyright (C) 2012 Robby <robby@chatbelgie.be> * Copyright (C) 2009-2010 Daniel De Graaf <danieldg@inspircd.org> diff --git a/modules/override.cpp b/modules/override.cpp index f3888aa75..d8626426c 100644 --- a/modules/override.cpp +++ b/modules/override.cpp @@ -2,7 +2,7 @@ * InspIRCd -- Internet Relay Chat Daemon * * Copyright (C) 2020 satmd <satmd@satmd.de> - * Copyright (C) 2017 B00mX0r <b00mx0r@aureus.pw> + * Copyright (C) 2017 Dylan Frank <b00mx0r@aureus.pw> * Copyright (C) 2013-2015 Attila Molnar <attilamolnar@hush.com> * Copyright (C) 2013, 2019-2024 Sadie Powell <sadie@witchery.services> * Copyright (C) 2013 Daniel Vassdal <shutter@canternet.org> diff --git a/modules/redirect.cpp b/modules/redirect.cpp index 826c1be37..957c477b2 100644 --- a/modules/redirect.cpp +++ b/modules/redirect.cpp @@ -2,7 +2,7 @@ * InspIRCd -- Internet Relay Chat Daemon * * Copyright (C) 2019-2023 Sadie Powell <sadie@witchery.services> - * Copyright (C) 2017 B00mX0r <b00mx0r@aureus.pw> + * Copyright (C) 2017 Dylan Frank <b00mx0r@aureus.pw> * Copyright (C) 2012-2014, 2016 Attila Molnar <attilamolnar@hush.com> * Copyright (C) 2012, 2019 Robby <robby@chatbelgie.be> * Copyright (C) 2012, 2014 Shawn Smith <ShawnSmith0828@gmail.com> diff --git a/modules/remove.cpp b/modules/remove.cpp index cc75961f7..894ab2a9a 100644 --- a/modules/remove.cpp +++ b/modules/remove.cpp @@ -1,8 +1,8 @@ /* * InspIRCd -- Internet Relay Chat Daemon * - * Copyright (C) 2017 B00mX0r <b00mx0r@aureus.pw> - * Copyright (C) 2013, 2018-2024 Sadie Powell <sadie@witchery.services> + * Copyright (C) 2017 Dylan Frank <b00mx0r@aureus.pw> + * Copyright (C) 2013, 2018-2025 Sadie Powell <sadie@witchery.services> * Copyright (C) 2012-2014 Attila Molnar <attilamolnar@hush.com> * Copyright (C) 2012 Robby <robby@chatbelgie.be> * Copyright (C) 2012 Justin Crawford <Justasic@Gmail.com> diff --git a/modules/satopic.cpp b/modules/satopic.cpp index d43b8cae5..14705ad4e 100644 --- a/modules/satopic.cpp +++ b/modules/satopic.cpp @@ -2,7 +2,7 @@ * InspIRCd -- Internet Relay Chat Daemon * * Copyright (C) 2019-2024 Sadie Powell <sadie@witchery.services> - * Copyright (C) 2017 B00mX0r <b00mx0r@aureus.pw> + * Copyright (C) 2017 Dylan Frank <b00mx0r@aureus.pw> * Copyright (C) 2016 Attila Molnar <attilamolnar@hush.com> * Copyright (C) 2012 Robby <robby@chatbelgie.be> * Copyright (C) 2009 Uli Schlachter <psychon@znc.in> diff --git a/modules/shun.cpp b/modules/shun.cpp index e95484784..af2a4dbf9 100644 --- a/modules/shun.cpp +++ b/modules/shun.cpp @@ -4,7 +4,7 @@ * Copyright (C) 2019 Matt Schatz <genius3000@g3k.solutions> * Copyright (C) 2018 linuxdaemon <linuxdaemon.irc@gmail.com> * Copyright (C) 2017-2025 Sadie Powell <sadie@witchery.services> - * Copyright (C) 2017 B00mX0r <b00mx0r@aureus.pw> + * Copyright (C) 2017 Dylan Frank <b00mx0r@aureus.pw> * Copyright (C) 2012-2013, 2016 Attila Molnar <attilamolnar@hush.com> * Copyright (C) 2012, 2019 Robby <robby@chatbelgie.be> * Copyright (C) 2012 Jens Voss <DukePyrolator@anope.org> diff --git a/modules/silence.cpp b/modules/silence.cpp index 9e1f2ab44..2b0aa46a2 100644 --- a/modules/silence.cpp +++ b/modules/silence.cpp @@ -4,7 +4,7 @@ * Copyright (C) 2021 Dominic Hamon * Copyright (C) 2019 linuxdaemon <linuxdaemon.irc@gmail.com> * Copyright (C) 2019 iwalkalone <iwalkalone69@gmail.com> - * Copyright (C) 2018-2024 Sadie Powell <sadie@witchery.services> + * Copyright (C) 2018-2025 Sadie Powell <sadie@witchery.services> * Copyright (C) 2015 Renegade334 <contact.caaeed4f@renegade334.me.uk> * Copyright (C) 2012, 2019 Robby <robby@chatbelgie.be> * Copyright (C) 2012 Attila Molnar <attilamolnar@hush.com> @@ -223,7 +223,7 @@ public: // Remove the old list and create a new one. Unset(user, false); - auto* list = new SilenceList(); + SilenceList* list = nullptr; irc::spacesepstream ts(value); while (!ts.StreamEnd()) @@ -259,32 +259,28 @@ public: } // Store the silence entry. + if (!list) + list = new SilenceList(); list->emplace(flags, mask); } - // If we have an empty list then don't store it. - if (list->empty()) - { - delete list; - return; - } - // The value was well formed. - Set(user, list, false); + if (list) + Set(user, list, false); } std::string ToInternal(const Extensible* container, void* item) const noexcept override { - SilenceList* list = static_cast<SilenceList*>(item); + auto* list = static_cast<SilenceList*>(item); std::string buf; - for (SilenceList::const_iterator iter = list->begin(); iter != list->end(); ++iter) + for (const auto& entry : *list) { - if (iter != list->begin()) + if (!buf.empty()) buf.push_back(' '); - buf.append(iter->mask); + buf.append(entry.mask); buf.push_back(' '); - buf.append(SilenceEntry::BitsToFlags(iter->flags)); + buf.append(SilenceEntry::BitsToFlags(entry.flags)); } return buf; } diff --git a/modules/spanningtree/away.cpp b/modules/spanningtree/away.cpp index 5a84d0255..46023f54a 100644 --- a/modules/spanningtree/away.cpp +++ b/modules/spanningtree/away.cpp @@ -2,7 +2,7 @@ * InspIRCd -- Internet Relay Chat Daemon * * Copyright (C) 2018, 2020, 2023 Sadie Powell <sadie@witchery.services> - * Copyright (C) 2018 B00mX0r <b00mx0r@aureus.pw> + * Copyright (C) 2018 Dylan Frank <b00mx0r@aureus.pw> * Copyright (C) 2013 Attila Molnar <attilamolnar@hush.com> * Copyright (C) 2012 Robby <robby@chatbelgie.be> * Copyright (C) 2009 Daniel De Graaf <danieldg@inspircd.org> diff --git a/modules/spanningtree/hmac.cpp b/modules/spanningtree/hmac.cpp index 4a97bb5a4..818248de7 100644 --- a/modules/spanningtree/hmac.cpp +++ b/modules/spanningtree/hmac.cpp @@ -3,7 +3,7 @@ * * Copyright (C) 2014 Matthew Martin <phy1729@gmail.com> * Copyright (C) 2013-2014 Attila Molnar <attilamolnar@hush.com> - * Copyright (C) 2013, 2019, 2021-2024 Sadie Powell <sadie@witchery.services> + * Copyright (C) 2013, 2019, 2021-2023, 2025 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 Robin Burchell <robin+git@viroteck.net> @@ -73,38 +73,45 @@ bool TreeSocket::ComparePass(const Link& link, const std::string& theirs) capab->auth_fingerprint = !link.Fingerprint.empty(); capab->auth_challenge = !capab->ourchallenge.empty() && !capab->theirchallenge.empty(); - std::string fp; + const auto* sslhook = SSLIOHook::IsSSL(this); + const auto* sslcert = sslhook ? sslhook->GetCertificate() : nullptr; + const auto sslcert_usable = sslcert && sslcert->IsUsable(); + const auto fp = sslcert_usable ? sslcert->GetFingerprint() : ""; if (capab->auth_fingerprint) { - std::string badfps; - auto foundfp = false; - - auto* sslhook = SSLIOHook::IsSSL(this); - auto* sslcert = sslhook ? sslhook->GetCertificate() : nullptr; - if (sslcert && sslcert->IsUsable()) + std::string sslerror; + if (!sslhook) + sslerror = "not using TLS"; + if (!sslcert) + sslerror = "not using a TLS client certificate"; + else if (!sslcert_usable) + sslerror = "using an invalid (probably expired) TLS client certificate"; + else { + std::string badfps; + auto foundfp = false; for (const auto& fingerprint : sslcert->GetFingerprints()) { if (InspIRCd::TimingSafeCompare(link.Fingerprint, fingerprint)) { - fp = fingerprint; foundfp = true; break; } - badfps.append(badfps.empty() ? "" : ", ").append(fingerprint); } + if (!foundfp) + { + sslerror = INSP_FORMAT("not using the correct TLS client certificate (need \"{}\" got \"{}\")", + link.Fingerprint, badfps.empty() ? "(none)" : badfps); + } } /* Require fingerprint to exist and match */ - if (!foundfp) + if (!sslerror.empty()) { - if (badfps.empty()) - badfps = "(none)"; - - ServerInstance->SNO.WriteToSnoMask('l', "Invalid TLS certificate fingerprint on link {}: need \"{}\" got \"{}\"", - link.Name, link.Fingerprint, badfps); - SendError("Invalid TLS certificate fingerprint: " + badfps); + ServerInstance->SNO.WriteToSnoMask('l', "Incorrect TLS client certificate on link {}: {}", + link.Name, sslerror); + SendError("Incorrect TLS client certificate: " + sslerror); return false; } } @@ -128,7 +135,7 @@ bool TreeSocket::ComparePass(const Link& link, const std::string& theirs) // this time if ((!capab->auth_fingerprint) && (!fp.empty())) { - ServerInstance->SNO.WriteToSnoMask('l', "TLS certificate fingerprint for link {} is \"{}\". " + ServerInstance->SNO.WriteToSnoMask('l', "TLS client certificate fingerprint for link {} is \"{}\". " "You can improve security by specifying this in <link:fingerprint>.", link.Name, fp); } diff --git a/modules/spanningtree/link.h b/modules/spanningtree/link.h index 8c54b3eb6..cdd141188 100644 --- a/modules/spanningtree/link.h +++ b/modules/spanningtree/link.h @@ -3,7 +3,7 @@ * * Copyright (C) 2021 Dominic Hamon * Copyright (C) 2016 Attila Molnar <attilamolnar@hush.com> - * Copyright (C) 2013, 2020-2023 Sadie Powell <sadie@witchery.services> + * Copyright (C) 2013, 2020-2023, 2025 Sadie Powell <sadie@witchery.services> * Copyright (C) 2013 Adam <Adam@anope.org> * Copyright (C) 2012 Robby <robby@chatbelgie.be> * Copyright (C) 2009 Uli Schlachter <psychon@znc.in> @@ -56,6 +56,7 @@ public: std::shared_ptr<ConfigTag> tag; std::vector<std::string> servers; unsigned long Period; + unsigned long BootPeriod; time_t NextConnectTime; /** Negative == inactive */ int position; diff --git a/modules/spanningtree/main.cpp b/modules/spanningtree/main.cpp index 04f5ac1be..c45b176a6 100644 --- a/modules/spanningtree/main.cpp +++ b/modules/spanningtree/main.cpp @@ -702,7 +702,7 @@ void ModuleSpanningTree::ReadConfig(ConfigStatus& status) // Re-read config stuff try { - Utils->ReadConfiguration(); + Utils->ReadConfiguration(status); } catch (const ModuleException& e) { diff --git a/modules/spanningtree/override_map.cpp b/modules/spanningtree/override_map.cpp index 2983030ce..4f7064687 100644 --- a/modules/spanningtree/override_map.cpp +++ b/modules/spanningtree/override_map.cpp @@ -3,7 +3,7 @@ * * Copyright (C) 2021 Dominic Hamon * Copyright (C) 2018-2025 Sadie Powell <sadie@witchery.services> - * Copyright (C) 2017 B00mX0r <b00mx0r@aureus.pw> + * Copyright (C) 2017 Dylan Frank <b00mx0r@aureus.pw> * Copyright (C) 2014 Adam <Adam@anope.org> * Copyright (C) 2013-2016 Attila Molnar <attilamolnar@hush.com> * Copyright (C) 2012 Robby <robby@chatbelgie.be> diff --git a/modules/spanningtree/sinfo.cpp b/modules/spanningtree/sinfo.cpp index 4bc56d0db..54074b73c 100644 --- a/modules/spanningtree/sinfo.cpp +++ b/modules/spanningtree/sinfo.cpp @@ -2,7 +2,7 @@ * InspIRCd -- Internet Relay Chat Daemon * * Copyright (C) 2018-2020, 2022-2023, 2025 Sadie Powell <sadie@witchery.services> - * Copyright (C) 2017 B00mX0r <b00mx0r@aureus.pw> + * Copyright (C) 2017 Dylan Frank <b00mx0r@aureus.pw> * Copyright (C) 2014 Attila Molnar <attilamolnar@hush.com> * * This file is part of InspIRCd. InspIRCd is free software: you can diff --git a/modules/spanningtree/treeserver.cpp b/modules/spanningtree/treeserver.cpp index c202685ed..7302e4f55 100644 --- a/modules/spanningtree/treeserver.cpp +++ b/modules/spanningtree/treeserver.cpp @@ -3,7 +3,7 @@ * * Copyright (C) 2021 Dominic Hamon * Copyright (C) 2018-2024 Sadie Powell <sadie@witchery.services> - * Copyright (C) 2017 B00mX0r <b00mx0r@aureus.pw> + * Copyright (C) 2017 Dylan Frank <b00mx0r@aureus.pw> * Copyright (C) 2013-2016 Attila Molnar <attilamolnar@hush.com> * Copyright (C) 2012 Robby <robby@chatbelgie.be> * Copyright (C) 2009 Daniel De Graaf <danieldg@inspircd.org> diff --git a/modules/spanningtree/utils.cpp b/modules/spanningtree/utils.cpp index f26af0cb7..240d5a3ee 100644 --- a/modules/spanningtree/utils.cpp +++ b/modules/spanningtree/utils.cpp @@ -236,7 +236,7 @@ void SpanningTreeUtilities::RefreshIPCache() } } -void SpanningTreeUtilities::ReadConfiguration() +void SpanningTreeUtilities::ReadConfiguration(ConfigStatus& status) { const auto& mtag = ServerInstance->Config->ConfValue("spanningtree"); @@ -353,7 +353,8 @@ void SpanningTreeUtilities::ReadConfiguration() { auto A = std::make_shared<Autoconnect>(tag); A->Period = tag->getDuration("period", 60, 1); - A->NextConnectTime = ServerInstance->Time() + A->Period; + A->BootPeriod = tag->getDuration("bootperiod", A->Period, 1); + A->NextConnectTime = ServerInstance->Time() + (status.initial ? A->BootPeriod : A->Period); A->position = -1; irc::spacesepstream ss(tag->getString("server")); std::string server; diff --git a/modules/spanningtree/utils.h b/modules/spanningtree/utils.h index ac4d3eb1a..aa2ecc9fe 100644 --- a/modules/spanningtree/utils.h +++ b/modules/spanningtree/utils.h @@ -2,7 +2,7 @@ * InspIRCd -- Internet Relay Chat Daemon * * Copyright (C) 2021 Dominic Hamon - * Copyright (C) 2013, 2017-2018, 2020-2023 Sadie Powell <sadie@witchery.services> + * Copyright (C) 2013, 2017-2018, 2020-2023, 2025 Sadie Powell <sadie@witchery.services> * Copyright (C) 2012-2013, 2015-2016 Attila Molnar <attilamolnar@hush.com> * Copyright (C) 2012 Robby <robby@chatbelgie.be> * Copyright (C) 2009 Daniel De Graaf <danieldg@inspircd.org> @@ -139,7 +139,7 @@ public: /** Read the spanningtree module's tags from the config file */ - void ReadConfiguration(); + void ReadConfiguration(ConfigStatus& status); /** Handle nick collision */ diff --git a/modules/sqloper.cpp b/modules/sqloper.cpp index 0cd2a4135..8524009ca 100644 --- a/modules/sqloper.cpp +++ b/modules/sqloper.cpp @@ -1,8 +1,7 @@ /* * InspIRCd -- Internet Relay Chat Daemon * - * Copyright (C) 2019 B00mX0r <b00mx0r@aureus.pw> - * Copyright (C) 2018 Dylan Frank <b00mx0r@aureus.pw> + * Copyright (C) 2018-2019 Dylan Frank <b00mx0r@aureus.pw> * Copyright (C) 2014, 2018 Attila Molnar <attilamolnar@hush.com> * Copyright (C) 2013, 2017-2024 Sadie Powell <sadie@witchery.services> * Copyright (C) 2012 Robby <robby@chatbelgie.be> diff --git a/modules/sslinfo.cpp b/modules/sslinfo.cpp index 1d0c0edd8..32b2fd8ac 100644 --- a/modules/sslinfo.cpp +++ b/modules/sslinfo.cpp @@ -379,7 +379,7 @@ public: whois.SendLine(RPL_WHOISSECURE, "is using a secure connection"); ssl_cert* cert = cmd.sslapi.GetCertificate(whois.GetTarget()); - if (!cert || !cert->IsUsable()) + if (cert && cert->IsUsable()) { if (!cmd.operonlyfp || whois.IsSelfWhois() || whois.GetSource()->IsOper()) { diff --git a/modules/timedbans.cpp b/modules/timedbans.cpp index 3ee089030..8c2b2f281 100644 --- a/modules/timedbans.cpp +++ b/modules/timedbans.cpp @@ -4,7 +4,7 @@ * Copyright (C) 2020 iwalkalone <iwalkalone69@gmail.com> * Copyright (C) 2019 Matt Schatz <genius3000@g3k.solutions> * Copyright (C) 2018 linuxdaemon <linuxdaemon.irc@gmail.com> - * Copyright (C) 2017 B00mX0r <b00mx0r@aureus.pw> + * Copyright (C) 2017 Dylan Frank <b00mx0r@aureus.pw> * Copyright (C) 2013, 2017, 2019-2023, 2025 Sadie Powell <sadie@witchery.services> * Copyright (C) 2012-2016 Attila Molnar <attilamolnar@hush.com> * Copyright (C) 2012 Robby <robby@chatbelgie.be> diff --git a/modules/uninvite.cpp b/modules/uninvite.cpp index 882433597..6324a6772 100644 --- a/modules/uninvite.cpp +++ b/modules/uninvite.cpp @@ -2,7 +2,7 @@ * InspIRCd -- Internet Relay Chat Daemon * * Copyright (C) 2018-2024 Sadie Powell <sadie@witchery.services> - * Copyright (C) 2017 B00mX0r <b00mx0r@aureus.pw> + * Copyright (C) 2017 Dylan Frank <b00mx0r@aureus.pw> * 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> |
