summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSadie Powell <sadie@witchery.services>2021-05-31 20:57:48 +0100
committerSadie Powell <sadie@witchery.services>2021-05-31 20:57:48 +0100
commitdf4313f5bbacbfcb6592b6d90fe5362192287d59 (patch)
treef16f74b745083d6f8575d86c8d19565869c4d9c4
parent53cd3f47b5c5afa503e96380e9e22d7d35108714 (diff)
parent3728a0bda1cf010520c4fae821fc9c98b2adb083 (diff)
Merge branch '2.0' into 2.1.
-rwxr-xr-xConfig3
-rw-r--r--include/language.h2
-rw-r--r--include/modes.h2
-rw-r--r--modules/commands/cs_access.cpp2
-rw-r--r--modules/commands/cs_flags.cpp2
-rw-r--r--modules/commands/cs_xop.cpp4
-rw-r--r--modules/commands/ns_info.cpp1
-rw-r--r--modules/commands/ns_register.cpp2
-rw-r--r--modules/commands/os_news.cpp6
-rw-r--r--modules/commands/os_sxline.cpp6
-rw-r--r--modules/extra/stats/irc2sql/tables.cpp18
-rw-r--r--modules/extra/stats/m_chanstats.cpp2
-rw-r--r--modules/fantasy.cpp2
-rw-r--r--modules/m_httpd.cpp2
-rw-r--r--modules/m_xmlrpc.cpp6
-rw-r--r--modules/pseudoclients/memoserv.cpp2
-rw-r--r--modules/pseudoclients/nickserv.cpp4
-rw-r--r--src/bots.cpp4
-rw-r--r--src/init.cpp13
-rw-r--r--src/tools/anopesmtp.cpp4
-rw-r--r--src/uplink.cpp3
21 files changed, 50 insertions, 40 deletions
diff --git a/Config b/Config
index 6bbf3e495..cf5b2f26d 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
diff --git a/include/language.h b/include/language.h
index 8cc3efc40..bdf5b3042 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 _("<unknown>")
#define NO_EXPIRE _("does not expire")
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 &param) anope_override;
- ChannelMode *Unwrap(ChannelMode *cm, Anope::string &param) = 0;
+ ChannelMode *Unwrap(ChannelMode *cm, Anope::string &param) 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<Anope::string> &params)
+ void Execute(CommandSource &source, const std::vector<Anope::string> &params) anope_override
{
ChannelInfo *ci = ChannelInfo::Find(params[0]);
if (ci == NULL)
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;
diff --git a/modules/commands/ns_register.cpp b/modules/commands/ns_register.cpp
index c8fdeb344..6fd66a33f 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<bool>("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<unsigned>("passlen", "32");
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<NewsItem *> &list = this->GetNewsList(n->type);
std::vector<NewsItem *>::iterator it = std::find(list.begin(), list.end(), n);
@@ -125,7 +125,7 @@ class MyNewsService : public NewsService
delete n;
}
- std::vector<NewsItem *> &GetNewsList(NewsType t)
+ std::vector<NewsItem *> &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/extra/stats/irc2sql/tables.cpp b/modules/extra/stats/irc2sql/tables.cpp
index 1c286a191..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=utf8;";
+ ") 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=utf8;";
+ ") 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=utf8;";
+ ") 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=utf8;";
+ ") 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=utf8;";
+ ") 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=utf8;";
+ ") 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=utf8;";
+ ") 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=utf8;";
+ ") 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=utf8;";
+ ") 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 716c24310..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=utf8;";
+ ") ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;";
this->RunQuery(query);
}
/* There is no CREATE OR REPLACE PROCEDURE in MySQL */
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<XMLRPCEvent *>::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<bool>(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<bool>("hidenetsplitquit"))
return;
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<ChannelInfo *>::iterator it = this->channels->begin(), it_end = this->channels->end(); it != it_end; ++it)
+ for (std::set<ChannelInfo *>::iterator it = this->channels->begin(), it_end = this->channels->end(); it != it_end;)
{
- ChannelInfo *ci = *it;
+ ChannelInfo *ci = *it++;
this->UnAssign(NULL, ci);
}
diff --git a/src/init.cpp b/src/init.cpp
index 049829bc4..7186cccfc 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();
}
}
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;
}
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();