From c67911bfcc44b8fe010f3a35e966746c30656d55 Mon Sep 17 00:00:00 2001 From: Matt Schatz Date: Tue, 16 Feb 2021 20:12:16 -0700 Subject: [PATCH 01/13] bots: Fix dtor channel iterator being invalidated. The call to UnAssign() erases the channel from the set which invalidates the iterator in this loop. Handle this in the same manner as the NickCore dtor. --- src/bots.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/bots.cpp b/src/bots.cpp index 2f6c916a7..94b688f0d 100644 --- a/src/bots.cpp +++ b/src/bots.cpp @@ -62,9 +62,9 @@ BotInfo::~BotInfo() IRCD->SendSQLineDel(&x); } - for (std::set::iterator it = this->channels->begin(), it_end = this->channels->end(); it != it_end; ++it) + for (std::set::iterator it = this->channels->begin(), it_end = this->channels->end(); it != it_end;) { - ChannelInfo *ci = *it; + ChannelInfo *ci = *it++; this->UnAssign(NULL, ci); } From 9483da32392f65a663edcaacc9b00ff0430494ee Mon Sep 17 00:00:00 2001 From: PeGaSuS Date: Fri, 19 Feb 2021 02:42:13 +0100 Subject: [PATCH 02/13] Added `Account` to show the main nick of a grouped nick(s). #270 --- modules/commands/ns_info.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/modules/commands/ns_info.cpp b/modules/commands/ns_info.cpp index 7a780c003..018872b7d 100644 --- a/modules/commands/ns_info.cpp +++ b/modules/commands/ns_info.cpp @@ -60,6 +60,7 @@ class CommandNSInfo : public Command InfoFormatter info(source.nc); + info[_("Account")] = na->nc->display; if (nick_online) { bool shown = false; From f83558f10b3ac6021b05fa187a9302310794f008 Mon Sep 17 00:00:00 2001 From: Sadie Powell Date: Thu, 8 Apr 2021 13:25:05 +0100 Subject: [PATCH 03/13] Log when freopen and chown fail. --- src/init.cpp | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/src/init.cpp b/src/init.cpp index 602311a52..9c85196b9 100644 --- a/src/init.cpp +++ b/src/init.cpp @@ -106,9 +106,12 @@ void Anope::Fork() #ifndef _WIN32 kill(getppid(), SIGUSR2); - freopen("/dev/null", "r", stdin); - freopen("/dev/null", "w", stdout); - freopen("/dev/null", "w", stderr); + if (!freopen("/dev/null", "r", stdin)) + Log() << "Unable to redirect stdin to /dev/null: " << Anope::LastError(); + if (!freopen("/dev/null", "w", stdout)) + Log() << "Unable to redirect stdout to /dev/null: " << Anope::LastError(); + if (!freopen("/dev/null", "w", stderr)) + Log() << "Unable to redirect stderr to /dev/null: " << Anope::LastError(); setpgid(0, 0); @@ -263,7 +266,9 @@ static void setuidgid() { LogFile* lf = li.logfiles[j]; - chown(lf->filename.c_str(), uid, gid); + errno = 0; + if (chown(lf->filename.c_str(), uid, gid) != 0) + Log() << "Unable to change the ownership of " << lf->filename << " to " << uid << "/" << gid << ": " << Anope::LastError(); } } From 683f42eeef9f82edcbf96349a21ed4153a80837c Mon Sep 17 00:00:00 2001 From: Sadie Powell Date: Thu, 8 Apr 2021 13:25:52 +0100 Subject: [PATCH 04/13] Use UTC in anopesmtp to fix a C++98 compat warning. --- src/tools/anopesmtp.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/tools/anopesmtp.cpp b/src/tools/anopesmtp.cpp index 396524049..d86f9c43f 100644 --- a/src/tools/anopesmtp.cpp +++ b/src/tools/anopesmtp.cpp @@ -112,9 +112,9 @@ static std::string GetTimeStamp() { char tbuf[256]; time_t t = time(NULL); - struct tm *tm = localtime(&t); + struct tm *tm = gmtime(&t); - strftime(tbuf, sizeof(tbuf) - 1, "%a, %d %b %Y %H:%M:%S %z", tm); + strftime(tbuf, sizeof(tbuf) - 1, "%a, %d %b %Y %H:%M:%S +0000", tm); return tbuf; } From faee68e85f23e50f6298dce93312b8a50afc2f88 Mon Sep 17 00:00:00 2001 From: Sadie Powell Date: Fri, 16 Apr 2021 21:39:15 +0100 Subject: [PATCH 05/13] Don't enforce casemapping when using the 1202 InspIRCd protocol. This allows older servers which use a module that provides custom casemapping (e.g. the ascii module) to link. --- modules/protocol/inspircd20.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/protocol/inspircd20.cpp b/modules/protocol/inspircd20.cpp index be478055f..3a557ae12 100644 --- a/modules/protocol/inspircd20.cpp +++ b/modules/protocol/inspircd20.cpp @@ -37,7 +37,7 @@ class InspIRCd20Proto : public IRCDProto void SendConnect() anope_override { UplinkSocket::Message() << "CAPAB START 1202"; - UplinkSocket::Message() << "CAPAB CAPABILITIES :PROTOCOL=1202 CASEMAPPING=" << Config->GetBlock("options")->Get("casemap", "ascii"); + UplinkSocket::Message() << "CAPAB CAPABILITIES :PROTOCOL=1202"; UplinkSocket::Message() << "CAPAB END"; insp12->SendConnect(); } From cdd9b6f11bbd35740b82bfd321f195cf9a8f30ce Mon Sep 17 00:00:00 2001 From: Sadie Powell Date: Fri, 16 Apr 2021 21:39:38 +0100 Subject: [PATCH 06/13] Default to the inspircd3 protocol module instead of inspircd20. --- data/example.conf | 2 +- data/stats.standalone.example.conf | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/data/example.conf b/data/example.conf index 0b160ab5c..b25578d10 100644 --- a/data/example.conf +++ b/data/example.conf @@ -265,7 +265,7 @@ serverinfo */ module { - name = "inspircd20" + name = "inspircd3" /* * Some protocol modules can enforce mode locks server-side. This reduces the spam caused by diff --git a/data/stats.standalone.example.conf b/data/stats.standalone.example.conf index af53a4046..79635891e 100644 --- a/data/stats.standalone.example.conf +++ b/data/stats.standalone.example.conf @@ -265,7 +265,7 @@ serverinfo */ module { - name = "inspircd20" + name = "inspircd3" } /* From c00ecc5e024251213a71673a63efe24e10d0cdbe Mon Sep 17 00:00:00 2001 From: Sadie Powell Date: Fri, 16 Apr 2021 22:08:29 +0100 Subject: [PATCH 07/13] Process writes to the uplink socket before quitting in all cases. This allows any error that might have been sent to the IRCd to actually be sent. --- src/uplink.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/uplink.cpp b/src/uplink.cpp index 7e8a15860..785ef88cd 100644 --- a/src/uplink.cpp +++ b/src/uplink.cpp @@ -94,14 +94,13 @@ UplinkSocket::~UplinkSocket() } IRCD->SendSquit(Me, Anope::QuitReason); - - this->ProcessWrite(); // Write out the last bit } for (unsigned i = Me->GetLinks().size(); i > 0; --i) if (!Me->GetLinks()[i - 1]->IsJuped()) Me->GetLinks()[i - 1]->Delete(Me->GetName() + " " + Me->GetLinks()[i - 1]->GetName()); + this->ProcessWrite(); // Write out the last bit UplinkSock = NULL; Me->Unsync(); From 095a25d4731c7b2df73174eaedecae90aa1e610b Mon Sep 17 00:00:00 2001 From: Sadie Powell Date: Tue, 27 Apr 2021 21:41:19 +0100 Subject: [PATCH 08/13] Add the anope_override keyword to methods that lack it. --- include/modes.h | 2 +- modules/commands/cs_access.cpp | 2 +- modules/commands/cs_flags.cpp | 2 +- modules/commands/cs_xop.cpp | 4 ++-- modules/commands/os_news.cpp | 6 +++--- modules/commands/os_sxline.cpp | 6 +++--- modules/fantasy.cpp | 2 +- modules/m_httpd.cpp | 2 +- modules/m_xmlrpc.cpp | 6 +++--- modules/pseudoclients/memoserv.cpp | 2 +- modules/pseudoclients/nickserv.cpp | 4 ++-- 11 files changed, 19 insertions(+), 19 deletions(-) diff --git a/include/modes.h b/include/modes.h index 0fa0d8d86..ed55f5911 100644 --- a/include/modes.h +++ b/include/modes.h @@ -221,7 +221,7 @@ class CoreExport ChannelModeVirtual : public T ChannelMode *Wrap(Anope::string ¶m) anope_override; - ChannelMode *Unwrap(ChannelMode *cm, Anope::string ¶m) = 0; + ChannelMode *Unwrap(ChannelMode *cm, Anope::string ¶m) anope_override = 0; }; /* The status a user has on a channel (+v, +h, +o) etc */ diff --git a/modules/commands/cs_access.cpp b/modules/commands/cs_access.cpp index 508274002..386978340 100644 --- a/modules/commands/cs_access.cpp +++ b/modules/commands/cs_access.cpp @@ -34,7 +34,7 @@ class AccessChanAccess : public ChanAccess return this->ci->GetLevel(name) != ACCESS_INVALID && this->level >= this->ci->GetLevel(name); } - Anope::string AccessSerialize() const + Anope::string AccessSerialize() const anope_override { return stringify(this->level); } diff --git a/modules/commands/cs_flags.cpp b/modules/commands/cs_flags.cpp index 179d04317..5fca415de 100644 --- a/modules/commands/cs_flags.cpp +++ b/modules/commands/cs_flags.cpp @@ -30,7 +30,7 @@ class FlagsChanAccess : public ChanAccess return false; } - Anope::string AccessSerialize() const + Anope::string AccessSerialize() const anope_override { return Anope::string(this->flags.begin(), this->flags.end()); } diff --git a/modules/commands/cs_xop.cpp b/modules/commands/cs_xop.cpp index 403920030..2b0cf413f 100644 --- a/modules/commands/cs_xop.cpp +++ b/modules/commands/cs_xop.cpp @@ -37,7 +37,7 @@ class XOPChanAccess : public ChanAccess return false; } - Anope::string AccessSerialize() const + Anope::string AccessSerialize() const anope_override { return this->type; } @@ -489,7 +489,7 @@ class CommandCSXOP : public Command return Anope::printf(Language::Translate(source.GetAccount(), _("Modify the list of %s users")), source.command.upper().c_str()); } - void Execute(CommandSource &source, const std::vector ¶ms) + void Execute(CommandSource &source, const std::vector ¶ms) anope_override { ChannelInfo *ci = ChannelInfo::Find(params[0]); if (ci == NULL) diff --git a/modules/commands/os_news.cpp b/modules/commands/os_news.cpp index d83e44025..f199cdad5 100644 --- a/modules/commands/os_news.cpp +++ b/modules/commands/os_news.cpp @@ -111,12 +111,12 @@ class MyNewsService : public NewsService return new MyNewsItem(); } - void AddNewsItem(NewsItem *n) + void AddNewsItem(NewsItem *n) anope_override { this->newsItems[n->type].push_back(n); } - void DelNewsItem(NewsItem *n) + void DelNewsItem(NewsItem *n) anope_override { std::vector &list = this->GetNewsList(n->type); std::vector::iterator it = std::find(list.begin(), list.end(), n); @@ -125,7 +125,7 @@ class MyNewsService : public NewsService delete n; } - std::vector &GetNewsList(NewsType t) + std::vector &GetNewsList(NewsType t) anope_override { return this->newsItems[t]; } diff --git a/modules/commands/os_sxline.cpp b/modules/commands/os_sxline.cpp index 4a0e92ed4..167115194 100644 --- a/modules/commands/os_sxline.cpp +++ b/modules/commands/os_sxline.cpp @@ -253,12 +253,12 @@ class CommandOSSXLineBase : public Command return; } - virtual bool OnHelp(CommandSource &source, const Anope::string &subcommand) = 0; + virtual bool OnHelp(CommandSource &source, const Anope::string &subcommand) anope_override = 0; }; class CommandOSSNLine : public CommandOSSXLineBase { - XLineManager *xlm() + XLineManager *xlm() anope_override { return this->snlines; } @@ -484,7 +484,7 @@ class CommandOSSNLine : public CommandOSSXLineBase class CommandOSSQLine : public CommandOSSXLineBase { - XLineManager *xlm() + XLineManager *xlm() anope_override { return this->sqlines; } diff --git a/modules/fantasy.cpp b/modules/fantasy.cpp index 45223f398..f5e544544 100644 --- a/modules/fantasy.cpp +++ b/modules/fantasy.cpp @@ -208,7 +208,7 @@ class Fantasy : public Module FOREACH_MOD(OnPostCommand, (source, cmd, params)); } - void OnBotInfo(CommandSource &source, BotInfo *bi, ChannelInfo *ci, InfoFormatter &info) + void OnBotInfo(CommandSource &source, BotInfo *bi, ChannelInfo *ci, InfoFormatter &info) anope_override { if (fantasy.HasExt(ci)) info.AddOption(_("Fantasy")); diff --git a/modules/m_httpd.cpp b/modules/m_httpd.cpp index b63b6685b..a3f2b0110 100644 --- a/modules/m_httpd.cpp +++ b/modules/m_httpd.cpp @@ -326,7 +326,7 @@ class MyHTTPProvider : public HTTPProvider, public Timer this->pages.erase(page->GetURL()); } - HTTPPage* FindPage(const Anope::string &pname) + HTTPPage* FindPage(const Anope::string &pname) anope_override { if (this->pages.count(pname) == 0) return NULL; diff --git a/modules/m_xmlrpc.cpp b/modules/m_xmlrpc.cpp index 3ab028629..867ae217d 100644 --- a/modules/m_xmlrpc.cpp +++ b/modules/m_xmlrpc.cpp @@ -39,12 +39,12 @@ class MyXMLRPCServiceInterface : public XMLRPCServiceInterface, public HTTPPage public: MyXMLRPCServiceInterface(Module *creator, const Anope::string &sname) : XMLRPCServiceInterface(creator, sname), HTTPPage("/xmlrpc", "text/xml") { } - void Register(XMLRPCEvent *event) + void Register(XMLRPCEvent *event) anope_override { this->events.push_back(event); } - void Unregister(XMLRPCEvent *event) + void Unregister(XMLRPCEvent *event) anope_override { std::deque::iterator it = std::find(this->events.begin(), this->events.end(), event); @@ -182,7 +182,7 @@ class MyXMLRPCServiceInterface : public XMLRPCServiceInterface, public HTTPPage return true; } - void Reply(XMLRPCRequest &request) + void Reply(XMLRPCRequest &request) anope_override { if (!request.id.empty()) request.reply("id", request.id); diff --git a/modules/pseudoclients/memoserv.cpp b/modules/pseudoclients/memoserv.cpp index 1d7e5d5bd..d4d00df64 100644 --- a/modules/pseudoclients/memoserv.cpp +++ b/modules/pseudoclients/memoserv.cpp @@ -129,7 +129,7 @@ class MemoServCore : public Module, public MemoServService return MEMO_SUCCESS; } - void Check(User *u) + void Check(User *u) anope_override { const NickCore *nc = u->Account(); if (!nc) diff --git a/modules/pseudoclients/nickserv.cpp b/modules/pseudoclients/nickserv.cpp index 73d9acf3d..013b067f9 100644 --- a/modules/pseudoclients/nickserv.cpp +++ b/modules/pseudoclients/nickserv.cpp @@ -495,14 +495,14 @@ class NickServCore : public Module, public NickServService "after %d days if not used."), nickserv_expire / 86400); } - void OnNickCoreCreate(NickCore *nc) + void OnNickCoreCreate(NickCore *nc) anope_override { /* Set default flags */ for (unsigned i = 0; i < defaults.size(); ++i) nc->Extend(defaults[i].upper()); } - void OnUserQuit(User *u, const Anope::string &msg) + void OnUserQuit(User *u, const Anope::string &msg) anope_override { if (u->server && !u->server->GetQuitReason().empty() && Config->GetModule(this)->Get("hidenetsplitquit")) return; From 6274bd0b34e51c3540f0dd467ab6a98567c502f6 Mon Sep 17 00:00:00 2001 From: Sadie Powell Date: Tue, 27 Apr 2021 23:18:04 +0100 Subject: [PATCH 09/13] Use utf8mb4 instead of utf8 in chanstats and irc2sql. The utf8 charset, confusingly, is an alias for utf8mb3 which is not a real UTF-8 encoding as it can only store three byte characters. The real UTF-8 charset is utf8mb4. --- modules/extra/stats/irc2sql/tables.cpp | 18 +++++++++--------- modules/extra/stats/m_chanstats.cpp | 2 +- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/modules/extra/stats/irc2sql/tables.cpp b/modules/extra/stats/irc2sql/tables.cpp index 1c286a191..598dc49a7 100644 --- a/modules/extra/stats/irc2sql/tables.cpp +++ b/modules/extra/stats/irc2sql/tables.cpp @@ -34,7 +34,7 @@ void IRC2SQL::CheckTables() "`countryname` varchar(50)," "PRIMARY KEY `end` (`end`)," "KEY `start` (`start`)" - ") ENGINE=MyISAM DEFAULT CHARSET=utf8;"; + ") ENGINE=MyISAM DEFAULT CHARSET=utf8mb4;"; this->RunQuery(query); } if (GeoIPDB.equals_ci("city") && !this->HasTable(prefix + "geoip_city_blocks")) @@ -45,7 +45,7 @@ void IRC2SQL::CheckTables() "`locId` INT UNSIGNED NOT NULL," "PRIMARY KEY `end` (`end`)," "KEY `start` (`start`)" - ") ENGINE=MyISAM DEFAULT CHARSET=utf8;"; + ") ENGINE=MyISAM DEFAULT CHARSET=utf8mb4;"; this->RunQuery(query); } @@ -60,7 +60,7 @@ void IRC2SQL::CheckTables() "`longitude` FLOAT," "`areaCode` INT," "PRIMARY KEY (`locId`)" - ") ENGINE=MyISAM DEFAULT CHARSET=utf8;"; + ") ENGINE=MyISAM DEFAULT CHARSET=utf8mb4;"; this->RunQuery(query); } if (GeoIPDB.equals_ci("city") && !this->HasTable(prefix + "geoip_city_region")) @@ -69,7 +69,7 @@ void IRC2SQL::CheckTables() "`region` CHAR(2) NOT NULL," "`regionname` VARCHAR(100) NOT NULL," "PRIMARY KEY (`country`,`region`)" - ") ENGINE=MyISAM DEFAULT CHARSET=utf8;"; + ") ENGINE=MyISAM DEFAULT CHARSET=utf8mb4;"; this->RunQuery(query); } if (!this->HasTable(prefix + "server")) @@ -87,7 +87,7 @@ void IRC2SQL::CheckTables() "`ulined` enum('Y','N') NOT NULL DEFAULT 'N'," "PRIMARY KEY (`id`)," "UNIQUE KEY `name` (`name`)" - ") ENGINE=MyISAM DEFAULT CHARSET=utf8;"; + ") ENGINE=MyISAM DEFAULT CHARSET=utf8mb4;"; this->RunQuery(query); } if (!this->HasTable(prefix + "chan")) @@ -101,7 +101,7 @@ void IRC2SQL::CheckTables() "`modes` varchar(512) DEFAULT NULL," "PRIMARY KEY (`chanid`)," "UNIQUE KEY `channel`(`channel`)" - ") ENGINE=MyISAM DEFAULT CHARSET=utf8;"; + ") ENGINE=MyISAM DEFAULT CHARSET=utf8mb4;"; this->RunQuery(query); } if (!this->HasTable(prefix + "user")) @@ -136,7 +136,7 @@ void IRC2SQL::CheckTables() "PRIMARY KEY (`nickid`)," "UNIQUE KEY `nick` (`nick`)," "KEY `servid` (`servid`)" - ") ENGINE=MyISAM DEFAULT CHARSET=utf8;"; + ") ENGINE=MyISAM DEFAULT CHARSET=utf8mb4;"; this->RunQuery(query); } if (!this->HasTable(prefix + "ison")) @@ -147,7 +147,7 @@ void IRC2SQL::CheckTables() "`modes` varchar(255) NOT NULL default ''," "PRIMARY KEY (`nickid`,`chanid`)," "KEY `modes` (`modes`)" - ") ENGINE=MyISAM DEFAULT CHARSET=utf8;"; + ") ENGINE=MyISAM DEFAULT CHARSET=utf8mb4;"; this->RunQuery(query); } if (!this->HasTable(prefix + "maxusers")) @@ -158,7 +158,7 @@ void IRC2SQL::CheckTables() "`maxtime` DATETIME NOT NULL," "`lastused` DATETIME NOT NULL," "UNIQUE KEY `name` (`name`)" - ") ENGINE=MyISAM DEFAULT CHARSET=utf8;"; + ") ENGINE=MyISAM DEFAULT CHARSET=utf8mb4;"; this->RunQuery(query); } if (this->HasProcedure(prefix + "UserConnect")) diff --git a/modules/extra/stats/m_chanstats.cpp b/modules/extra/stats/m_chanstats.cpp index 716c24310..a9c9bb8ae 100644 --- a/modules/extra/stats/m_chanstats.cpp +++ b/modules/extra/stats/m_chanstats.cpp @@ -317,7 +317,7 @@ class MChanstats : public Module "KEY `nick` (`nick`)," "KEY `chan_` (`chan`)," "KEY `type` (`type`)" - ") ENGINE=MyISAM DEFAULT CHARSET=utf8;"; + ") ENGINE=MyISAM DEFAULT CHARSET=utf8mb4;"; this->RunQuery(query); } /* There is no CREATE OR REPLACE PROCEDURE in MySQL */ From a040f177874c8018f391defa17e8ec0a253c8f24 Mon Sep 17 00:00:00 2001 From: Sadie Powell Date: Tue, 27 Apr 2021 23:21:07 +0100 Subject: [PATCH 10/13] Use InnoDB instead of the deprecated MyISAM engine. Ref: https://www.percona.com/blog/2016/10/11/mysql-8-0-end-myisam/ --- modules/extra/stats/irc2sql/tables.cpp | 18 +++++++++--------- modules/extra/stats/m_chanstats.cpp | 2 +- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/modules/extra/stats/irc2sql/tables.cpp b/modules/extra/stats/irc2sql/tables.cpp index 598dc49a7..28110fa9e 100644 --- a/modules/extra/stats/irc2sql/tables.cpp +++ b/modules/extra/stats/irc2sql/tables.cpp @@ -34,7 +34,7 @@ void IRC2SQL::CheckTables() "`countryname` varchar(50)," "PRIMARY KEY `end` (`end`)," "KEY `start` (`start`)" - ") ENGINE=MyISAM DEFAULT CHARSET=utf8mb4;"; + ") ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;"; this->RunQuery(query); } if (GeoIPDB.equals_ci("city") && !this->HasTable(prefix + "geoip_city_blocks")) @@ -45,7 +45,7 @@ void IRC2SQL::CheckTables() "`locId` INT UNSIGNED NOT NULL," "PRIMARY KEY `end` (`end`)," "KEY `start` (`start`)" - ") ENGINE=MyISAM DEFAULT CHARSET=utf8mb4;"; + ") ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;"; this->RunQuery(query); } @@ -60,7 +60,7 @@ void IRC2SQL::CheckTables() "`longitude` FLOAT," "`areaCode` INT," "PRIMARY KEY (`locId`)" - ") ENGINE=MyISAM DEFAULT CHARSET=utf8mb4;"; + ") ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;"; this->RunQuery(query); } if (GeoIPDB.equals_ci("city") && !this->HasTable(prefix + "geoip_city_region")) @@ -69,7 +69,7 @@ void IRC2SQL::CheckTables() "`region` CHAR(2) NOT NULL," "`regionname` VARCHAR(100) NOT NULL," "PRIMARY KEY (`country`,`region`)" - ") ENGINE=MyISAM DEFAULT CHARSET=utf8mb4;"; + ") ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;"; this->RunQuery(query); } if (!this->HasTable(prefix + "server")) @@ -87,7 +87,7 @@ void IRC2SQL::CheckTables() "`ulined` enum('Y','N') NOT NULL DEFAULT 'N'," "PRIMARY KEY (`id`)," "UNIQUE KEY `name` (`name`)" - ") ENGINE=MyISAM DEFAULT CHARSET=utf8mb4;"; + ") ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;"; this->RunQuery(query); } if (!this->HasTable(prefix + "chan")) @@ -101,7 +101,7 @@ void IRC2SQL::CheckTables() "`modes` varchar(512) DEFAULT NULL," "PRIMARY KEY (`chanid`)," "UNIQUE KEY `channel`(`channel`)" - ") ENGINE=MyISAM DEFAULT CHARSET=utf8mb4;"; + ") ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;"; this->RunQuery(query); } if (!this->HasTable(prefix + "user")) @@ -136,7 +136,7 @@ void IRC2SQL::CheckTables() "PRIMARY KEY (`nickid`)," "UNIQUE KEY `nick` (`nick`)," "KEY `servid` (`servid`)" - ") ENGINE=MyISAM DEFAULT CHARSET=utf8mb4;"; + ") ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;"; this->RunQuery(query); } if (!this->HasTable(prefix + "ison")) @@ -147,7 +147,7 @@ void IRC2SQL::CheckTables() "`modes` varchar(255) NOT NULL default ''," "PRIMARY KEY (`nickid`,`chanid`)," "KEY `modes` (`modes`)" - ") ENGINE=MyISAM DEFAULT CHARSET=utf8mb4;"; + ") ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;"; this->RunQuery(query); } if (!this->HasTable(prefix + "maxusers")) @@ -158,7 +158,7 @@ void IRC2SQL::CheckTables() "`maxtime` DATETIME NOT NULL," "`lastused` DATETIME NOT NULL," "UNIQUE KEY `name` (`name`)" - ") ENGINE=MyISAM DEFAULT CHARSET=utf8mb4;"; + ") ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;"; this->RunQuery(query); } if (this->HasProcedure(prefix + "UserConnect")) diff --git a/modules/extra/stats/m_chanstats.cpp b/modules/extra/stats/m_chanstats.cpp index a9c9bb8ae..403174e6a 100644 --- a/modules/extra/stats/m_chanstats.cpp +++ b/modules/extra/stats/m_chanstats.cpp @@ -317,7 +317,7 @@ class MChanstats : public Module "KEY `nick` (`nick`)," "KEY `chan_` (`chan`)," "KEY `type` (`type`)" - ") ENGINE=MyISAM DEFAULT CHARSET=utf8mb4;"; + ") ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;"; this->RunQuery(query); } /* There is no CREATE OR REPLACE PROCEDURE in MySQL */ From 100b24074d4a5680db33422bfb9131ceb0ade866 Mon Sep 17 00:00:00 2001 From: Sadie Powell Date: Sun, 23 May 2021 19:51:40 +0100 Subject: [PATCH 11/13] Improve the message for NICK_IDENTIFY_REQUIRED. --- include/language.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/language.h b/include/language.h index 8c2354e48..dfaf7140e 100644 --- a/include/language.h +++ b/include/language.h @@ -82,7 +82,7 @@ namespace Language #define CHAN_X_SUSPENDED _("Channel %s is currently suspended.") #define CHAN_X_NOT_REGISTERED _("Channel \002%s\002 isn't registered.") #define CHAN_X_NOT_IN_USE _("Channel \002%s\002 doesn't exist.") -#define NICK_IDENTIFY_REQUIRED _("Password authentication required for that command.") +#define NICK_IDENTIFY_REQUIRED _("You must be logged into an account to use that command.") #define MAIL_X_INVALID _("\002%s\002 is not a valid e-mail address.") #define UNKNOWN _("") #define NO_EXPIRE _("does not expire") From d2da73cf68a5150ec65f9d95c6906de5bd57a9cc Mon Sep 17 00:00:00 2001 From: Sadie Powell Date: Mon, 24 May 2021 20:51:07 +0100 Subject: [PATCH 12/13] Add the -devel switch to Config. This makes the script use defaults that make development easier. --- Config | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Config b/Config index c0df999c6..246209036 100755 --- a/Config +++ b/Config @@ -149,6 +149,9 @@ while [ $# -ge 1 ] ; do echo "-nointro Skip intro (disclaimer, etc)" echo "-quick Skip questions, go straight to cmake" exit 0 + elif [ $1 = "-devel" ] ; then + DEBUG="yes" + INSTDIR="$PWD/run" elif [ $1 = "-nocache" ] ; then IGNORE_CACHE="1" elif [ $1 = "-nointro" ] ; then From 3728a0bda1cf010520c4fae821fc9c98b2adb083 Mon Sep 17 00:00:00 2001 From: Sadie Powell Date: Mon, 31 May 2021 20:53:29 +0100 Subject: [PATCH 13/13] Fix some misleading indentation in ns_register. --- modules/commands/ns_register.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/modules/commands/ns_register.cpp b/modules/commands/ns_register.cpp index a4aa9f082..4ff4cca44 100644 --- a/modules/commands/ns_register.cpp +++ b/modules/commands/ns_register.cpp @@ -179,6 +179,7 @@ class CommandNSRegister : public Command } if (Config->GetModule("nickserv")->Get("restrictopernicks")) + { for (unsigned i = 0; i < Oper::opers.size(); ++i) { Oper *o = Oper::opers[i]; @@ -189,6 +190,7 @@ class CommandNSRegister : public Command return; } } + } unsigned int passlen = Config->GetModule("nickserv")->Get("passlen", "32");