diff options
| author | 2020-05-05 22:03:14 +0100 | |
|---|---|---|
| committer | 2020-05-05 22:03:14 +0100 | |
| commit | b755d2a778e0adb86c3b10757083c169eedb6de6 (patch) | |
| tree | 3d737ea47c535c4b60076feb26055e68f7d8aec5 /src/modules | |
| parent | Revert "Convert UserType to an enum class". (diff) | |
| parent | Fix shuns not being applied correctly. (diff) | |
Merge branch 'insp3' into master.
Diffstat (limited to 'src/modules')
92 files changed, 299 insertions, 271 deletions
diff --git a/src/modules/extra/m_geo_maxmind.cpp b/src/modules/extra/m_geo_maxmind.cpp index 64823acb4..f4fe7cc5e 100644 --- a/src/modules/extra/m_geo_maxmind.cpp +++ b/src/modules/extra/m_geo_maxmind.cpp @@ -1,7 +1,7 @@ /* * InspIRCd -- Internet Relay Chat Daemon * - * Copyright (C) 2019 Sadie Powell <sadie@witchery.services> + * Copyright (C) 2019-2020 Sadie Powell <sadie@witchery.services> * Copyright (C) 2019 Matt Schatz <genius3000@g3k.solutions> * * This file is part of InspIRCd. InspIRCd is free software: you can diff --git a/src/modules/extra/m_ldap.cpp b/src/modules/extra/m_ldap.cpp index 139fd9979..503ef4b3c 100644 --- a/src/modules/extra/m_ldap.cpp +++ b/src/modules/extra/m_ldap.cpp @@ -1,9 +1,9 @@ /* * InspIRCd -- Internet Relay Chat Daemon * + * Copyright (C) 2020 Joel Sing <joel@sing.id.au> * Copyright (C) 2019 linuxdaemon <linuxdaemon.irc@gmail.com> - * Copyright (C) 2019 Robby <robby@chatbelgie.be> - * Copyright (C) 2016-2019 Sadie Powell <sadie@witchery.services> + * Copyright (C) 2016-2020 Sadie Powell <sadie@witchery.services> * Copyright (C) 2014, 2016 Attila Molnar <attilamolnar@hush.com> * Copyright (C) 2013-2016 Adam <Adam@anope.org> * diff --git a/src/modules/extra/m_mysql.cpp b/src/modules/extra/m_mysql.cpp index a8b0cfd6b..622bb7e24 100644 --- a/src/modules/extra/m_mysql.cpp +++ b/src/modules/extra/m_mysql.cpp @@ -5,8 +5,8 @@ * Copyright (C) 2015 Daniel Vassdal <shutter@canternet.org> * Copyright (C) 2014, 2016 Adam <Adam@anope.org> * Copyright (C) 2013-2014 Attila Molnar <attilamolnar@hush.com> - * Copyright (C) 2013, 2016-2019 Sadie Powell <sadie@witchery.services> - * Copyright (C) 2012, 2019 Robby <robby@chatbelgie.be> + * Copyright (C) 2013, 2016-2020 Sadie Powell <sadie@witchery.services> + * Copyright (C) 2012 Robby <robby@chatbelgie.be> * Copyright (C) 2012 ChrisTX <xpipe@hotmail.de> * Copyright (C) 2009-2010 Daniel De Graaf <danieldg@inspircd.org> * Copyright (C) 2009 Uli Schlachter <psychon@inspircd.org> @@ -66,7 +66,7 @@ * worker thread wakes up, and checks if there is a request at the head of its queue. * If there is, it processes this request, blocking the worker thread but leaving the ircd * thread to go about its business as usual. During this period, the ircd thread is able - * to insert futher pending requests into the queue. + * to insert further pending requests into the queue. * * Once the processing of a request is complete, it is removed from the incoming queue to * an outgoing queue, and initialized as a 'response'. The worker thread then signals the @@ -83,7 +83,7 @@ * one the module was originally instantiated upon, there is a chance of all hell breaking loose * if a module is ever put in a re-enterant state (stack corruption could occur, crashes, data * corruption, and worse, so DONT think about it until the day comes when InspIRCd is 100% - * gauranteed threadsafe!) + * guaranteed threadsafe!) */ class SQLConnection; @@ -366,7 +366,7 @@ class SQLConnection : public SQL::Provider /* Parse the command string and dispatch it to mysql */ if (CheckConnection() && !mysql_real_query(connection, query.data(), query.length())) { - /* Successfull query */ + /* Successful query */ MYSQL_RES* res = mysql_use_result(connection); unsigned long rows = mysql_affected_rows(connection); return new MySQLresult(res, rows); diff --git a/src/modules/extra/m_pgsql.cpp b/src/modules/extra/m_pgsql.cpp index cf618af7b..dc9be948e 100644 --- a/src/modules/extra/m_pgsql.cpp +++ b/src/modules/extra/m_pgsql.cpp @@ -3,7 +3,7 @@ * * Copyright (C) 2016 Adam <Adam@anope.org> * Copyright (C) 2015 Daniel Vassdal <shutter@canternet.org> - * Copyright (C) 2013, 2016-2019 Sadie Powell <sadie@witchery.services> + * Copyright (C) 2013, 2016-2020 Sadie Powell <sadie@witchery.services> * Copyright (C) 2012-2015 Attila Molnar <attilamolnar@hush.com> * Copyright (C) 2012 Robby <robby@chatbelgie.be> * Copyright (C) 2009-2010 Daniel De Graaf <danieldg@inspircd.org> @@ -55,14 +55,23 @@ class ModulePgSQL; typedef insp::flat_map<std::string, SQLConn*> ConnMap; -/* CREAD, Connecting and wants read event - * CWRITE, Connecting and wants write event - * WREAD, Connected/Working and wants read event - * WWRITE, Connected/Working and wants write event - * RREAD, Resetting and wants read event - * RWRITE, Resetting and wants write event - */ -enum SQLstatus { CREAD, CWRITE, WREAD, WWRITE, RREAD, RWRITE }; +enum SQLstatus +{ + // The connection has died. + DEAD, + + // Connecting and wants read event. + CREAD, + + // Connecting and wants write event. + CWRITE, + + // Connected/working and wants read event. + WREAD, + + // Connected/working and wants write event. + WWRITE +}; class ReconnectTimer : public Timer { @@ -188,10 +197,7 @@ class SQLConn : public SQL::Provider, public EventHandler , qinprog(NULL, "") { if (!DoConnect()) - { - ServerInstance->Logs.Log(MODNAME, LOG_DEFAULT, "WARNING: Could not connect to database " + tag->getString("id")); DelayReconnect(); - } } CullResult cull() override @@ -215,6 +221,7 @@ class SQLConn : public SQL::Provider, public EventHandler q->OnError(err); delete q; } + Close(); } void OnEventHandlerRead() override @@ -260,34 +267,40 @@ class SQLConn : public SQL::Provider, public EventHandler return conninfo.str(); } + bool HandleConnectError(const char* reason) + { + ServerInstance->Logs.Log(MODNAME, LOG_DEFAULT, "Could not connect to the \"%s\" database: %s", + GetId().c_str(), reason); + return false; + } + bool DoConnect() { sql = PQconnectStart(GetDSN().c_str()); if (!sql) - return false; + return HandleConnectError("PQconnectStart returned NULL"); if(PQstatus(sql) == CONNECTION_BAD) - return false; + return HandleConnectError("connection status is bad"); if(PQsetnonblocking(sql, 1) == -1) - return false; + return HandleConnectError("unable to mark fd as non-blocking"); - /* OK, we've initalised the connection, now to get it hooked into the socket engine + /* OK, we've initialised the connection, now to get it hooked into the socket engine * and then start polling it. */ - this->fd = PQsocket(sql); - - if(this->fd <= -1) - return false; + SetFd(PQsocket(sql)); + if(!HasFd()) + return HandleConnectError("PQsocket returned an invalid fd"); if (!SocketEngine::AddFd(this, FD_WANT_NO_WRITE | FD_WANT_NO_READ)) - { - ServerInstance->Logs.Log(MODNAME, LOG_DEBUG, "BUG: Couldn't add pgsql socket to socket engine"); - return false; - } + return HandleConnectError("could not add the pgsql socket to the socket engine"); /* Socket all hooked into the engine, now to tell PgSQL to start connecting */ - return DoPoll(); + if (!DoPoll()) + return HandleConnectError("could not poll the connection state"); + + return true; } bool DoPoll() @@ -303,6 +316,8 @@ class SQLConn : public SQL::Provider, public EventHandler status = CREAD; return true; case PGRES_POLLING_FAILED: + SocketEngine::ChangeEventMask(this, FD_WANT_NO_READ | FD_WANT_NO_WRITE); + status = DEAD; return false; case PGRES_POLLING_OK: SocketEngine::ChangeEventMask(this, FD_WANT_POLL_READ | FD_WANT_NO_WRITE); @@ -384,30 +399,6 @@ restart: } } - bool DoResetPoll() - { - switch(PQresetPoll(sql)) - { - case PGRES_POLLING_WRITING: - SocketEngine::ChangeEventMask(this, FD_WANT_POLL_WRITE | FD_WANT_NO_READ); - status = CWRITE; - return DoPoll(); - case PGRES_POLLING_READING: - SocketEngine::ChangeEventMask(this, FD_WANT_POLL_READ | FD_WANT_NO_WRITE); - status = CREAD; - return true; - case PGRES_POLLING_FAILED: - return false; - case PGRES_POLLING_OK: - SocketEngine::ChangeEventMask(this, FD_WANT_POLL_READ | FD_WANT_NO_WRITE); - status = WWRITE; - DoConnectedPoll(); - return true; - default: - return true; - } - } - void DelayReconnect(); void DoEvent() @@ -416,11 +407,7 @@ restart: { DoPoll(); } - else if((status == RREAD) || (status == RWRITE)) - { - DoResetPoll(); - } - else + else if (status == WREAD || status == WWRITE) { DoConnectedPoll(); } @@ -521,7 +508,10 @@ restart: void Close() { - SocketEngine::DelFd(this); + status = DEAD; + + if (HasFd() && SocketEngine::HasFd(GetFd())) + SocketEngine::DelFd(this); if(sql) { @@ -566,8 +556,13 @@ class ModulePgSQL : public Module if (curr == connections.end()) { SQLConn* conn = new SQLConn(this, i->second); - conns.insert(std::make_pair(id, conn)); - ServerInstance->Modules.AddService(*conn); + if (conn->status != DEAD) + { + conns.insert(std::make_pair(id, conn)); + ServerInstance->Modules.AddService(*conn); + } + // If the connection is dead it has already been queued for culling + // at the end of the main loop so we don't need to delete it here. } else { @@ -628,17 +623,17 @@ bool ReconnectTimer::Tick(time_t time) void SQLConn::DelayReconnect() { + status = DEAD; ModulePgSQL* mod = (ModulePgSQL*)(Module*)creator; + ConnMap::iterator it = mod->connections.find(conf->getString("id")); if (it != mod->connections.end()) - { mod->connections.erase(it); - ServerInstance->GlobalCulls.AddItem((EventHandler*)this); - if (!mod->retimer) - { - mod->retimer = new ReconnectTimer(mod); - ServerInstance->Timers.AddTimer(mod->retimer); - } + ServerInstance->GlobalCulls.AddItem((EventHandler*)this); + if (!mod->retimer) + { + mod->retimer = new ReconnectTimer(mod); + ServerInstance->Timers.AddTimer(mod->retimer); } } diff --git a/src/modules/extra/m_ssl_gnutls.cpp b/src/modules/extra/m_ssl_gnutls.cpp index 79fc15234..81d08d373 100644 --- a/src/modules/extra/m_ssl_gnutls.cpp +++ b/src/modules/extra/m_ssl_gnutls.cpp @@ -1,13 +1,13 @@ /* * InspIRCd -- Internet Relay Chat Daemon * + * Copyright (C) 2020 Matt Schatz <genius3000@g3k.solutions> * Copyright (C) 2019 linuxdaemon <linuxdaemon.irc@gmail.com> - * Copyright (C) 2019 Matt Schatz <genius3000@g3k.solutions> - * Copyright (C) 2013-2014, 2016-2019 Sadie Powell <sadie@witchery.services> + * Copyright (C) 2013-2014, 2016-2020 Sadie Powell <sadie@witchery.services> * Copyright (C) 2013 Daniel Vassdal <shutter@canternet.org> * Copyright (C) 2012-2017 Attila Molnar <attilamolnar@hush.com> * Copyright (C) 2012-2013, 2016 Adam <Adam@anope.org> - * Copyright (C) 2012, 2019 Robby <robby@chatbelgie.be> + * Copyright (C) 2012 Robby <robby@chatbelgie.be> * Copyright (C) 2012 ChrisTX <xpipe@hotmail.de> * Copyright (C) 2009-2010 Daniel De Graaf <danieldg@inspircd.org> * Copyright (C) 2009 Uli Schlachter <psychon@inspircd.org> @@ -1144,32 +1144,35 @@ class ModuleSSLGnuTLS : public Module throw ModuleException("Error while initializing the default TLS (SSL) profile - " + ex.GetReason()); } } - - for (ConfigIter i = tags.first; i != tags.second; ++i) + else { - ConfigTag* tag = i->second; - if (!stdalgo::string::equalsci(tag->getString("provider"), "gnutls")) - continue; - - std::string name = tag->getString("name"); - if (name.empty()) + ServerInstance->Logs.Log(MODNAME, LOG_DEFAULT, "You have defined an <sslprofile> tag; you should use this in place of \"gnutls\" when configuring TLS (SSL) connections in <bind:ssl> or <link:ssl>"); + for (ConfigIter i = tags.first; i != tags.second; ++i) { - ServerInstance->Logs.Log(MODNAME, LOG_DEFAULT, "Ignoring <sslprofile> tag without name at " + tag->getTagLocation()); - continue; - } + ConfigTag* tag = i->second; + if (!stdalgo::string::equalsci(tag->getString("provider"), "gnutls")) + continue; - reference<GnuTLSIOHookProvider> prov; - try - { - GnuTLS::Profile::Config profileconfig(name, tag); - prov = new GnuTLSIOHookProvider(this, profileconfig); - } - catch (CoreException& ex) - { - throw ModuleException("Error while initializing TLS (SSL) profile \"" + name + "\" at " + tag->getTagLocation() + " - " + ex.GetReason()); - } + std::string name = tag->getString("name"); + if (name.empty()) + { + ServerInstance->Logs.Log(MODNAME, LOG_DEFAULT, "Ignoring <sslprofile> tag without name at " + tag->getTagLocation()); + continue; + } - newprofiles.push_back(prov); + reference<GnuTLSIOHookProvider> prov; + try + { + GnuTLS::Profile::Config profileconfig(name, tag); + prov = new GnuTLSIOHookProvider(this, profileconfig); + } + catch (CoreException& ex) + { + throw ModuleException("Error while initializing TLS (SSL) profile \"" + name + "\" at " + tag->getTagLocation() + " - " + ex.GetReason()); + } + + newprofiles.push_back(prov); + } } // New profiles are ok, begin using them diff --git a/src/modules/extra/m_ssl_mbedtls.cpp b/src/modules/extra/m_ssl_mbedtls.cpp index 00434b984..aa9ace195 100644 --- a/src/modules/extra/m_ssl_mbedtls.cpp +++ b/src/modules/extra/m_ssl_mbedtls.cpp @@ -1,7 +1,7 @@ /* * InspIRCd -- Internet Relay Chat Daemon * - * Copyright (C) 2019 Matt Schatz <genius3000@g3k.solutions> + * Copyright (C) 2020 Matt Schatz <genius3000@g3k.solutions> * Copyright (C) 2016-2020 Sadie Powell <sadie@witchery.services> * Copyright (C) 2016-2017 Attila Molnar <attilamolnar@hush.com> * @@ -887,32 +887,35 @@ class ModuleSSLmbedTLS : public Module throw ModuleException("Error while initializing the default TLS (SSL) profile - " + ex.GetReason()); } } - - for (ConfigIter i = tags.first; i != tags.second; ++i) + else { - ConfigTag* tag = i->second; - if (!stdalgo::string::equalsci(tag->getString("provider"), "mbedtls")) - continue; - - std::string name = tag->getString("name"); - if (name.empty()) + ServerInstance->Logs.Log(MODNAME, LOG_DEFAULT, "You have defined an <sslprofile> tag; you should use this in place of \"mbedtls\" when configuring TLS (SSL) connections in <bind:ssl> or <link:ssl>"); + for (ConfigIter i = tags.first; i != tags.second; ++i) { - ServerInstance->Logs.Log(MODNAME, LOG_DEFAULT, "Ignoring <sslprofile> tag without name at " + tag->getTagLocation()); - continue; - } + ConfigTag* tag = i->second; + if (!stdalgo::string::equalsci(tag->getString("provider"), "mbedtls")) + continue; - reference<mbedTLSIOHookProvider> prov; - try - { - mbedTLS::Profile::Config profileconfig(name, tag, ctr_drbg); - prov = new mbedTLSIOHookProvider(this, profileconfig); - } - catch (CoreException& ex) - { - throw ModuleException("Error while initializing TLS (SSL) profile \"" + name + "\" at " + tag->getTagLocation() + " - " + ex.GetReason()); - } + std::string name = tag->getString("name"); + if (name.empty()) + { + ServerInstance->Logs.Log(MODNAME, LOG_DEFAULT, "Ignoring <sslprofile> tag without name at " + tag->getTagLocation()); + continue; + } - newprofiles.push_back(prov); + reference<mbedTLSIOHookProvider> prov; + try + { + mbedTLS::Profile::Config profileconfig(name, tag, ctr_drbg); + prov = new mbedTLSIOHookProvider(this, profileconfig); + } + catch (CoreException& ex) + { + throw ModuleException("Error while initializing TLS (SSL) profile \"" + name + "\" at " + tag->getTagLocation() + " - " + ex.GetReason()); + } + + newprofiles.push_back(prov); + } } // New profiles are ok, begin using them diff --git a/src/modules/extra/m_ssl_openssl.cpp b/src/modules/extra/m_ssl_openssl.cpp index 404766d6d..780938c3d 100644 --- a/src/modules/extra/m_ssl_openssl.cpp +++ b/src/modules/extra/m_ssl_openssl.cpp @@ -1,14 +1,14 @@ /* * InspIRCd -- Internet Relay Chat Daemon * + * Copyright (C) 2020 Matt Schatz <genius3000@g3k.solutions> * Copyright (C) 2019 linuxdaemon <linuxdaemon.irc@gmail.com> - * Copyright (C) 2019 Matt Schatz <genius3000@g3k.solutions> * Copyright (C) 2017 Wade Cline <wadecline@hotmail.com> * Copyright (C) 2014, 2016 Adam <Adam@anope.org> * Copyright (C) 2014 Julien Vehent <julien@linuxwall.info> - * Copyright (C) 2013-2014, 2016-2019 Sadie Powell <sadie@witchery.services> + * Copyright (C) 2013-2014, 2016-2020 Sadie Powell <sadie@witchery.services> * Copyright (C) 2012-2017 Attila Molnar <attilamolnar@hush.com> - * Copyright (C) 2012, 2019 Robby <robby@chatbelgie.be> + * Copyright (C) 2012 Robby <robby@chatbelgie.be> * Copyright (C) 2012 ChrisTX <xpipe@hotmail.de> * Copyright (C) 2009-2010 Daniel De Graaf <danieldg@inspircd.org> * Copyright (C) 2008 Robin Burchell <robin+git@viroteck.net> @@ -922,31 +922,34 @@ class ModuleSSLOpenSSL : public Module throw ModuleException("Error while initializing the default TLS (SSL) profile - " + ex.GetReason()); } } - - for (ConfigIter i = tags.first; i != tags.second; ++i) + else { - ConfigTag* tag = i->second; - if (!stdalgo::string::equalsci(tag->getString("provider"), "openssl")) - continue; - - std::string name = tag->getString("name"); - if (name.empty()) + ServerInstance->Logs.Log(MODNAME, LOG_DEFAULT, "You have defined an <sslprofile> tag; you should use this in place of \"openssl\" when configuring TLS (SSL) connections in <bind:ssl> or <link:ssl>"); + for (ConfigIter i = tags.first; i != tags.second; ++i) { - ServerInstance->Logs.Log(MODNAME, LOG_DEFAULT, "Ignoring <sslprofile> tag without name at " + tag->getTagLocation()); - continue; - } + ConfigTag* tag = i->second; + if (!stdalgo::string::equalsci(tag->getString("provider"), "openssl")) + continue; - reference<OpenSSLIOHookProvider> prov; - try - { - prov = new OpenSSLIOHookProvider(this, name, tag); - } - catch (CoreException& ex) - { - throw ModuleException("Error while initializing TLS (SSL) profile \"" + name + "\" at " + tag->getTagLocation() + " - " + ex.GetReason()); - } + std::string name = tag->getString("name"); + if (name.empty()) + { + ServerInstance->Logs.Log(MODNAME, LOG_DEFAULT, "Ignoring <sslprofile> tag without name at " + tag->getTagLocation()); + continue; + } + + reference<OpenSSLIOHookProvider> prov; + try + { + prov = new OpenSSLIOHookProvider(this, name, tag); + } + catch (CoreException& ex) + { + throw ModuleException("Error while initializing TLS (SSL) profile \"" + name + "\" at " + tag->getTagLocation() + " - " + ex.GetReason()); + } - newprofiles.push_back(prov); + newprofiles.push_back(prov); + } } for (ProfileList::iterator i = profiles.begin(); i != profiles.end(); ++i) diff --git a/src/modules/extra/m_sslrehashsignal.cpp b/src/modules/extra/m_sslrehashsignal.cpp index cbf8ec22f..c50ea10f2 100644 --- a/src/modules/extra/m_sslrehashsignal.cpp +++ b/src/modules/extra/m_sslrehashsignal.cpp @@ -1,7 +1,8 @@ /* * InspIRCd -- Internet Relay Chat Daemon * - * Copyright (C) 2018-2019 Sadie Powell <sadie@witchery.services> + * Copyright (C) 2020 Matt Schatz <genius3000@g3k.solutions> + * Copyright (C) 2018-2020 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/src/modules/m_alias.cpp b/src/modules/m_alias.cpp index 6d3e1a60d..33bf47a2c 100644 --- a/src/modules/m_alias.cpp +++ b/src/modules/m_alias.cpp @@ -161,7 +161,7 @@ class ModuleAlias : public Module ModResult OnPreCommand(std::string& command, CommandBase::Params& parameters, LocalUser* user, bool validated) override { - /* If theyre not registered yet, we dont want + /* If they're not registered yet, we dont want * to know. */ if (user->registered != REG_ALL) diff --git a/src/modules/m_anticaps.cpp b/src/modules/m_anticaps.cpp index 2eba5a19e..ab6a7653f 100644 --- a/src/modules/m_anticaps.cpp +++ b/src/modules/m_anticaps.cpp @@ -2,7 +2,7 @@ * InspIRCd -- Internet Relay Chat Daemon * * Copyright (C) 2019 Robby <robby@chatbelgie.be> - * Copyright (C) 2018-2019 Sadie Powell <sadie@witchery.services> + * Copyright (C) 2018-2020 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/src/modules/m_autoop.cpp b/src/modules/m_autoop.cpp index b944a0a40..63f51cc76 100644 --- a/src/modules/m_autoop.cpp +++ b/src/modules/m_autoop.cpp @@ -1,7 +1,7 @@ /* * InspIRCd -- Internet Relay Chat Daemon * - * Copyright (C) 2013, 2017-2019 Sadie Powell <sadie@witchery.services> + * Copyright (C) 2013, 2017-2020 Sadie Powell <sadie@witchery.services> * Copyright (C) 2012-2015 Attila Molnar <attilamolnar@hush.com> * Copyright (C) 2012, 2019 Robby <robby@chatbelgie.be> * Copyright (C) 2011 jackmcbarn <jackmcbarn@inspircd.org> diff --git a/src/modules/m_banexception.cpp b/src/modules/m_banexception.cpp index 01b7401b1..f9b3159d2 100644 --- a/src/modules/m_banexception.cpp +++ b/src/modules/m_banexception.cpp @@ -1,7 +1,7 @@ /* * InspIRCd -- Internet Relay Chat Daemon * - * Copyright (C) 2013, 2017-2019 Sadie Powell <sadie@witchery.services> + * Copyright (C) 2013, 2017-2020 Sadie Powell <sadie@witchery.services> * Copyright (C) 2012-2013 Attila Molnar <attilamolnar@hush.com> * Copyright (C) 2012, 2019 Robby <robby@chatbelgie.be> * Copyright (C) 2009-2010 Daniel De Graaf <danieldg@inspircd.org> diff --git a/src/modules/m_blockcolor.cpp b/src/modules/m_blockcolor.cpp index 408367145..b04f0cb84 100644 --- a/src/modules/m_blockcolor.cpp +++ b/src/modules/m_blockcolor.cpp @@ -2,7 +2,7 @@ * InspIRCd -- Internet Relay Chat Daemon * * Copyright (C) 2019 Matt Schatz <genius3000@g3k.solutions> - * Copyright (C) 2013, 2017 Sadie Powell <sadie@witchery.services> + * Copyright (C) 2013, 2017, 2020 Sadie Powell <sadie@witchery.services> * Copyright (C) 2012, 2018 Robby <robby@chatbelgie.be> * Copyright (C) 2012 Shawn Smith <ShawnSmith0828@gmail.com> * Copyright (C) 2012 DjSlash <djslash@djslash.org> diff --git a/src/modules/m_botmode.cpp b/src/modules/m_botmode.cpp index 482cf8875..18c1951f9 100644 --- a/src/modules/m_botmode.cpp +++ b/src/modules/m_botmode.cpp @@ -1,7 +1,7 @@ /* * InspIRCd -- Internet Relay Chat Daemon * - * Copyright (C) 2013, 2017-2019 Sadie Powell <sadie@witchery.services> + * Copyright (C) 2013, 2017-2020 Sadie Powell <sadie@witchery.services> * Copyright (C) 2012, 2015 Attila Molnar <attilamolnar@hush.com> * Copyright (C) 2012 Shawn Smith <ShawnSmith0828@gmail.com> * Copyright (C) 2012 Robby <robby@chatbelgie.be> diff --git a/src/modules/m_callerid.cpp b/src/modules/m_callerid.cpp index 5c480a9ef..3a7d56ab7 100644 --- a/src/modules/m_callerid.cpp +++ b/src/modules/m_callerid.cpp @@ -201,7 +201,7 @@ public: parameter = (action.second ? "" : "-") + action.first->uuid; } - /** Will take any number of nicks (up to MaxTargets), which can be seperated by commas. + /** Will take any number of nicks (up to MaxTargets), which can be separated by commas. * - in front of any nick removes, and an * lists. This effectively means you can do: * /accept nick1,nick2,nick3,* * to add 3 nicks and then show your list @@ -242,12 +242,12 @@ public: RouteDescriptor GetRouting(User* user, const Params& parameters) override { // There is a list in parameters[0] in two cases: - // Either when the source is remote, this happens because 2.0 servers send comma seperated uuid lists, + // Either when the source is remote, this happens because 2.0 servers send comma separated uuid lists, // we don't split those but broadcast them, as before. // // Or if the source is local then LoopCall() runs OnPostCommand() after each entry in the list, // meaning the linking module has sent an ACCEPT already for each entry in the list to the - // appropiate server and the ACCEPT with the list of nicks (this) doesn't need to be sent anywhere. + // appropriate server and the ACCEPT with the list of nicks (this) doesn't need to be sent anywhere. if ((!IS_LOCAL(user)) && (parameters[0].find(',') != std::string::npos)) return ROUTE_BROADCAST; diff --git a/src/modules/m_cban.cpp b/src/modules/m_cban.cpp index 67eee3382..3759d4278 100644 --- a/src/modules/m_cban.cpp +++ b/src/modules/m_cban.cpp @@ -3,7 +3,7 @@ * * Copyright (C) 2019 Matt Schatz <genius3000@g3k.solutions> * Copyright (C) 2018 linuxdaemon <linuxdaemon.irc@gmail.com> - * Copyright (C) 2013, 2017-2018 Sadie Powell <sadie@witchery.services> + * Copyright (C) 2013, 2017-2018, 2020 Sadie Powell <sadie@witchery.services> * Copyright (C) 2012-2013, 2016 Attila Molnar <attilamolnar@hush.com> * Copyright (C) 2012, 2019 Robby <robby@chatbelgie.be> * Copyright (C) 2009 John Brooks <special@inspircd.org> diff --git a/src/modules/m_cgiirc.cpp b/src/modules/m_cgiirc.cpp index e80e8d83a..8dc504ad0 100644 --- a/src/modules/m_cgiirc.cpp +++ b/src/modules/m_cgiirc.cpp @@ -4,7 +4,7 @@ * Copyright (C) 2019 linuxdaemon <linuxdaemon.irc@gmail.com> * Copyright (C) 2014 md_5 <git@md-5.net> * Copyright (C) 2014 Googolplexed <googol@googolplexed.net> - * Copyright (C) 2013, 2017-2018 Sadie Powell <sadie@witchery.services> + * Copyright (C) 2013, 2017-2018, 2020 Sadie Powell <sadie@witchery.services> * Copyright (C) 2013 Adam <Adam@anope.org> * Copyright (C) 2012-2013, 2015 Attila Molnar <attilamolnar@hush.com> * Copyright (C) 2012, 2019 Robby <robby@chatbelgie.be> diff --git a/src/modules/m_chanfilter.cpp b/src/modules/m_chanfilter.cpp index 19f40cebf..af940fa77 100644 --- a/src/modules/m_chanfilter.cpp +++ b/src/modules/m_chanfilter.cpp @@ -2,8 +2,8 @@ * InspIRCd -- Internet Relay Chat Daemon * * Copyright (C) 2019 linuxdaemon <linuxdaemon.irc@gmail.com> - * Copyright (C) 2013, 2017-2019 Sadie Powell <sadie@witchery.services> - * Copyright (C) 2012-2014, 2016 Attila Molnar <attilamolnar@hush.com> + * Copyright (C) 2013, 2017-2020 Sadie Powell <sadie@witchery.services> + * Copyright (C) 2012-2014 Attila Molnar <attilamolnar@hush.com> * Copyright (C) 2012, 2018 Robby <robby@chatbelgie.be> * Copyright (C) 2009 Daniel De Graaf <danieldg@inspircd.org> * Copyright (C) 2007 Dennis Friis <peavey@inspircd.org> diff --git a/src/modules/m_check.cpp b/src/modules/m_check.cpp index 0005ec56a..809b4b465 100644 --- a/src/modules/m_check.cpp +++ b/src/modules/m_check.cpp @@ -2,7 +2,7 @@ * InspIRCd -- Internet Relay Chat Daemon * * Copyright (C) 2013-2016 Attila Molnar <attilamolnar@hush.com> - * Copyright (C) 2013, 2017-2019 Sadie Powell <sadie@witchery.services> + * Copyright (C) 2013, 2017-2020 Sadie Powell <sadie@witchery.services> * Copyright (C) 2012, 2019 Robby <robby@chatbelgie.be> * Copyright (C) 2010 Craig Edwards <brain@inspircd.org> * Copyright (C) 2009-2010 Daniel De Graaf <danieldg@inspircd.org> diff --git a/src/modules/m_chghost.cpp b/src/modules/m_chghost.cpp index 6e1db3dc9..51f3b76a4 100644 --- a/src/modules/m_chghost.cpp +++ b/src/modules/m_chghost.cpp @@ -1,7 +1,7 @@ /* * InspIRCd -- Internet Relay Chat Daemon * - * Copyright (C) 2013-2014, 2017-2018 Sadie Powell <sadie@witchery.services> + * Copyright (C) 2013-2014, 2017-2018, 2020 Sadie Powell <sadie@witchery.services> * Copyright (C) 2012-2014, 2016 Attila Molnar <attilamolnar@hush.com> * Copyright (C) 2012, 2019 Robby <robby@chatbelgie.be> * Copyright (C) 2009, 2012 Daniel De Graaf <danieldg@inspircd.org> diff --git a/src/modules/m_commonchans.cpp b/src/modules/m_commonchans.cpp index d596dbced..912689800 100644 --- a/src/modules/m_commonchans.cpp +++ b/src/modules/m_commonchans.cpp @@ -1,7 +1,7 @@ /* * InspIRCd -- Internet Relay Chat Daemon * - * Copyright (C) 2013, 2017, 2019 Sadie Powell <sadie@witchery.services> + * Copyright (C) 2013, 2017, 2019-2020 Sadie Powell <sadie@witchery.services> * Copyright (C) 2012, 2019 Robby <robby@chatbelgie.be> * Copyright (C) 2012 Attila Molnar <attilamolnar@hush.com> * Copyright (C) 2009-2010 Daniel De Graaf <danieldg@inspircd.org> diff --git a/src/modules/m_customtitle.cpp b/src/modules/m_customtitle.cpp index 1ef53439c..bca9aea98 100644 --- a/src/modules/m_customtitle.cpp +++ b/src/modules/m_customtitle.cpp @@ -2,7 +2,7 @@ * InspIRCd -- Internet Relay Chat Daemon * * Copyright (C) 2018 linuxdaemon <linuxdaemon.irc@gmail.com> - * Copyright (C) 2013, 2017-2018 Sadie Powell <sadie@witchery.services> + * Copyright (C) 2013, 2017-2018, 2020 Sadie Powell <sadie@witchery.services> * Copyright (C) 2012, 2019 Robby <robby@chatbelgie.be> * Copyright (C) 2012, 2015-2016 Attila Molnar <attilamolnar@hush.com> * Copyright (C) 2010 Craig Edwards <brain@inspircd.org> diff --git a/src/modules/m_cycle.cpp b/src/modules/m_cycle.cpp index 5a477737f..bfc9ffc76 100644 --- a/src/modules/m_cycle.cpp +++ b/src/modules/m_cycle.cpp @@ -2,7 +2,7 @@ * InspIRCd -- Internet Relay Chat Daemon * * Copyright (C) 2017 B00mX0r <b00mx0r@aureus.pw> - * Copyright (C) 2013, 2018 Sadie Powell <sadie@witchery.services> + * Copyright (C) 2013, 2018, 2020 Sadie Powell <sadie@witchery.services> * Copyright (C) 2012-2014, 2016 Attila Molnar <attilamolnar@hush.com> * Copyright (C) 2012, 2019 Robby <robby@chatbelgie.be> * Copyright (C) 2010 Craig Edwards <brain@inspircd.org> diff --git a/src/modules/m_delaymsg.cpp b/src/modules/m_delaymsg.cpp index dbc1f751a..eb0a7633e 100644 --- a/src/modules/m_delaymsg.cpp +++ b/src/modules/m_delaymsg.cpp @@ -1,7 +1,7 @@ /* * InspIRCd -- Internet Relay Chat Daemon * - * Copyright (C) 2013, 2017-2019 Sadie Powell <sadie@witchery.services> + * Copyright (C) 2013, 2017-2020 Sadie Powell <sadie@witchery.services> * Copyright (C) 2012-2015 Attila Molnar <attilamolnar@hush.com> * Copyright (C) 2012, 2019 Robby <robby@chatbelgie.be> * Copyright (C) 2009-2010 Daniel De Graaf <danieldg@inspircd.org> diff --git a/src/modules/m_disable.cpp b/src/modules/m_disable.cpp index e96b2259c..e56a8295f 100644 --- a/src/modules/m_disable.cpp +++ b/src/modules/m_disable.cpp @@ -1,7 +1,7 @@ /* * InspIRCd -- Internet Relay Chat Daemon * - * Copyright (C) 2019 Sadie Powell <sadie@witchery.services> + * Copyright (C) 2019-2020 Sadie Powell <sadie@witchery.services> * Copyright (C) 2019 Robby <robby@chatbelgie.be> * * This file is part of InspIRCd. InspIRCd is free software: you can diff --git a/src/modules/m_dnsbl.cpp b/src/modules/m_dnsbl.cpp index 61cc1a255..286e3c2dd 100644 --- a/src/modules/m_dnsbl.cpp +++ b/src/modules/m_dnsbl.cpp @@ -1,8 +1,8 @@ /* * InspIRCd -- Internet Relay Chat Daemon * + * Copyright (C) 2018-2020 Matt Schatz <genius3000@g3k.solutions> * Copyright (C) 2018-2019 linuxdaemon <linuxdaemon.irc@gmail.com> - * Copyright (C) 2018-2019 Matt Schatz <genius3000@g3k.solutions> * Copyright (C) 2013, 2016-2019 Sadie Powell <sadie@witchery.services> * Copyright (C) 2013, 2015-2016 Adam <Adam@anope.org> * Copyright (C) 2012-2016 Attila Molnar <attilamolnar@hush.com> diff --git a/src/modules/m_exemptchanops.cpp b/src/modules/m_exemptchanops.cpp index 8c0eb688b..c5744c525 100644 --- a/src/modules/m_exemptchanops.cpp +++ b/src/modules/m_exemptchanops.cpp @@ -2,7 +2,7 @@ * InspIRCd -- Internet Relay Chat Daemon * * Copyright (C) 2013-2015 Attila Molnar <attilamolnar@hush.com> - * Copyright (C) 2013, 2017-2019 Sadie Powell <sadie@witchery.services> + * Copyright (C) 2013, 2017-2020 Sadie Powell <sadie@witchery.services> * Copyright (C) 2012, 2019 Robby <robby@chatbelgie.be> * Copyright (C) 2010 Craig Edwards <brain@inspircd.org> * Copyright (C) 2009-2010 Daniel De Graaf <danieldg@inspircd.org> diff --git a/src/modules/m_filter.cpp b/src/modules/m_filter.cpp index dfe64266b..6588467f4 100644 --- a/src/modules/m_filter.cpp +++ b/src/modules/m_filter.cpp @@ -542,7 +542,7 @@ ModResult ModuleFilter::OnPreCommand(std::string& command, CommandBase::Params& /* We cant block a part or quit, so instead we change the reason to 'Reason filtered' */ parameters[parting ? 1 : 0] = "Reason filtered"; - /* We're warning or blocking, OR theyre quitting and its a KILL action + /* We're warning or blocking, OR they're quitting and its a KILL action * (we cant kill someone whos already quitting, so filter them anyway) */ if ((f->action == FA_WARN) || (f->action == FA_BLOCK) || (((!parting) && (f->action == FA_KILL))) || (f->action == FA_SILENT)) diff --git a/src/modules/m_geoban.cpp b/src/modules/m_geoban.cpp index 2088bf2e2..924737373 100644 --- a/src/modules/m_geoban.cpp +++ b/src/modules/m_geoban.cpp @@ -1,6 +1,7 @@ /* * InspIRCd -- Internet Relay Chat Daemon * + * Copyright (C) 2020 Matt Schatz <genius3000@g3k.solutions> * Copyright (C) 2019 Sadie Powell <sadie@witchery.services> * * This file is part of InspIRCd. InspIRCd is free software: you can diff --git a/src/modules/m_globalload.cpp b/src/modules/m_globalload.cpp index adbdeb58c..fc814635c 100644 --- a/src/modules/m_globalload.cpp +++ b/src/modules/m_globalload.cpp @@ -1,7 +1,7 @@ /* * InspIRCd -- Internet Relay Chat Daemon * - * Copyright (C) 2013, 2017-2018 Sadie Powell <sadie@witchery.services> + * Copyright (C) 2013, 2017-2018, 2020 Sadie Powell <sadie@witchery.services> * Copyright (C) 2012, 2019 Robby <robby@chatbelgie.be> * Copyright (C) 2012, 2014-2016 Attila Molnar <attilamolnar@hush.com> * Copyright (C) 2009-2010 Daniel De Graaf <danieldg@inspircd.org> diff --git a/src/modules/m_globops.cpp b/src/modules/m_globops.cpp index d96540396..c45259779 100644 --- a/src/modules/m_globops.cpp +++ b/src/modules/m_globops.cpp @@ -1,7 +1,7 @@ /* * InspIRCd -- Internet Relay Chat Daemon * - * Copyright (C) 2013, 2018-2019 Sadie Powell <sadie@witchery.services> + * Copyright (C) 2013, 2018-2020 Sadie Powell <sadie@witchery.services> * Copyright (C) 2012, 2019 Robby <robby@chatbelgie.be> * Copyright (C) 2012 Attila Molnar <attilamolnar@hush.com> * Copyright (C) 2009-2010 Daniel De Graaf <danieldg@inspircd.org> diff --git a/src/modules/m_haproxy.cpp b/src/modules/m_haproxy.cpp index 86a90f433..3bb78ef7a 100644 --- a/src/modules/m_haproxy.cpp +++ b/src/modules/m_haproxy.cpp @@ -1,8 +1,8 @@ /* * InspIRCd -- Internet Relay Chat Daemon * + * Copyright (C) 2019-2020 Matt Schatz <genius3000@g3k.solutions> * Copyright (C) 2019 linuxdaemon <linuxdaemon.irc@gmail.com> - * Copyright (C) 2019 Matt Schatz <genius3000@g3k.solutions> * Copyright (C) 2018-2019 Sadie Powell <sadie@witchery.services> * * This file is part of InspIRCd. InspIRCd is free software: you can diff --git a/src/modules/m_hostchange.cpp b/src/modules/m_hostchange.cpp index 9b1b6adc5..a6358e44a 100644 --- a/src/modules/m_hostchange.cpp +++ b/src/modules/m_hostchange.cpp @@ -1,7 +1,7 @@ /* * InspIRCd -- Internet Relay Chat Daemon * - * Copyright (C) 2013, 2018-2019 Sadie Powell <sadie@witchery.services> + * Copyright (C) 2013, 2018-2020 Sadie Powell <sadie@witchery.services> * Copyright (C) 2012-2014 Attila Molnar <attilamolnar@hush.com> * Copyright (C) 2012 Robby <robby@chatbelgie.be> * Copyright (C) 2009 Robin Burchell <robin+git@viroteck.net> @@ -145,7 +145,7 @@ private: insp::flat_set<int> ports; const std::string portlist = tag->getString("ports"); - if (!ports.empty()) + if (!portlist.empty()) { irc::portparser portrange(portlist, false); while (int port = portrange.GetToken()) diff --git a/src/modules/m_httpd.cpp b/src/modules/m_httpd.cpp index c1973654a..ebd0404b5 100644 --- a/src/modules/m_httpd.cpp +++ b/src/modules/m_httpd.cpp @@ -3,9 +3,9 @@ * * Copyright (C) 2019 linuxdaemon <linuxdaemon.irc@gmail.com> * Copyright (C) 2018 edef <edef@edef.eu> - * Copyright (C) 2013-2014, 2017-2019 Sadie Powell <sadie@witchery.services> + * Copyright (C) 2013-2014, 2017-2020 Sadie Powell <sadie@witchery.services> * Copyright (C) 2012-2016 Attila Molnar <attilamolnar@hush.com> - * Copyright (C) 2012, 2019 Robby <robby@chatbelgie.be> + * Copyright (C) 2012 Robby <robby@chatbelgie.be> * Copyright (C) 2009 Uli Schlachter <psychon@inspircd.org> * Copyright (C) 2009 Daniel De Graaf <danieldg@inspircd.org> * Copyright (C) 2008 Robin Burchell <robin+git@viroteck.net> @@ -272,7 +272,7 @@ class HttpServerSocket : public BufferedSocket, public Timer, public insp::intru else rheaders.RemoveHeader("Content-Type"); - /* Supporting Connection: keep-alive causes a whole world of hurt syncronizing timeouts, + /* Supporting Connection: keep-alive causes a whole world of hurt synchronizing timeouts, * so remove it, its not essential for what we need. */ rheaders.SetHeader("Connection", "Close"); diff --git a/src/modules/m_httpd_acl.cpp b/src/modules/m_httpd_acl.cpp index 8a3303d1e..7715d9b1e 100644 --- a/src/modules/m_httpd_acl.cpp +++ b/src/modules/m_httpd_acl.cpp @@ -2,7 +2,7 @@ * InspIRCd -- Internet Relay Chat Daemon * * Copyright (C) 2018-2019 linuxdaemon <linuxdaemon.irc@gmail.com> - * Copyright (C) 2013, 2017-2018 Sadie Powell <sadie@witchery.services> + * Copyright (C) 2013, 2017-2018, 2020 Sadie Powell <sadie@witchery.services> * Copyright (C) 2013, 2015 Attila Molnar <attilamolnar@hush.com> * Copyright (C) 2012, 2019 Robby <robby@chatbelgie.be> * Copyright (C) 2009-2010 Daniel De Graaf <danieldg@inspircd.org> diff --git a/src/modules/m_ident.cpp b/src/modules/m_ident.cpp index ca4722a80..d0c7392e0 100644 --- a/src/modules/m_ident.cpp +++ b/src/modules/m_ident.cpp @@ -1,7 +1,7 @@ /* * InspIRCd -- Internet Relay Chat Daemon * - * Copyright (C) 2013, 2018-2019 Sadie Powell <sadie@witchery.services> + * Copyright (C) 2013, 2018-2020 Sadie Powell <sadie@witchery.services> * Copyright (C) 2012-2015 Attila Molnar <attilamolnar@hush.com> * Copyright (C) 2012-2013 Robby <robby@chatbelgie.be> * Copyright (C) 2009-2010 Daniel De Graaf <danieldg@inspircd.org> @@ -61,7 +61,7 @@ enum * our ident lookup class that is outside of this module, or out- * side of the control of the class. There are no timers, internal * events, or such, which will cause the socket to be deleted, - * queued for deletion, etc. In fact, theres not even any queueing! + * queued for deletion, etc. In fact, there's not even any queueing! * * Using this framework we have a much more stable module. * @@ -183,7 +183,7 @@ class IdentRequestSocket : public EventHandler void Close() { - /* Remove ident socket from engine, and close it, but dont detatch it + /* Remove ident socket from engine, and close it, but dont detach it * from its parent user class, or attempt to delete its memory. */ if (HasFd()) diff --git a/src/modules/m_inviteexception.cpp b/src/modules/m_inviteexception.cpp index 7a92fa371..13c08ac9d 100644 --- a/src/modules/m_inviteexception.cpp +++ b/src/modules/m_inviteexception.cpp @@ -2,7 +2,7 @@ * InspIRCd -- Internet Relay Chat Daemon * * Copyright (C) 2018 linuxdaemon <linuxdaemon.irc@gmail.com> - * Copyright (C) 2013, 2017-2019 Sadie Powell <sadie@witchery.services> + * Copyright (C) 2013, 2017-2020 Sadie Powell <sadie@witchery.services> * Copyright (C) 2012-2013 Attila Molnar <attilamolnar@hush.com> * Copyright (C) 2012, 2019 Robby <robby@chatbelgie.be> * Copyright (C) 2009-2010 Daniel De Graaf <danieldg@inspircd.org> diff --git a/src/modules/m_ircv3_capnotify.cpp b/src/modules/m_ircv3_capnotify.cpp index 944e63486..5c7c68449 100644 --- a/src/modules/m_ircv3_capnotify.cpp +++ b/src/modules/m_ircv3_capnotify.cpp @@ -1,7 +1,7 @@ /* * InspIRCd -- Internet Relay Chat Daemon * - * Copyright (C) 2018-2019 Sadie Powell <sadie@witchery.services> + * Copyright (C) 2018-2020 Sadie Powell <sadie@witchery.services> * Copyright (C) 2015, 2018 Attila Molnar <attilamolnar@hush.com> * * This file is part of InspIRCd. InspIRCd is free software: you can @@ -165,7 +165,7 @@ class ModuleIRCv3CapNotify : public Module, public Cap::EventListener, public Re void OnReloadModuleRestore(Module* mod, void* data) override { - // Reloading can change the set of caps provided by a module so assuming that if the reload succeded all + // Reloading can change the set of caps provided by a module so assuming that if the reload succeeded all // caps that the module previously provided are available or all were lost if the reload failed is wrong. // Instead, we verify the availability of each cap individually. dynamic_reference_nocheck<Cap::Manager> capmanager(this, "capmanager"); diff --git a/src/modules/m_ircv3_ctctags.cpp b/src/modules/m_ircv3_ctctags.cpp index 2a1d5d656..4b538ac07 100644 --- a/src/modules/m_ircv3_ctctags.cpp +++ b/src/modules/m_ircv3_ctctags.cpp @@ -261,6 +261,7 @@ class C2CTags : public ClientProtocol::MessageTagProvider Cap::Capability& cap; public: + bool allowclientonlytags; C2CTags(Module* Creator, Cap::Capability& Cap) : ClientProtocol::MessageTagProvider(Creator) , cap(Cap) @@ -271,7 +272,7 @@ class C2CTags : public ClientProtocol::MessageTagProvider { // A client-only tag is prefixed with a plus sign (+) and otherwise conforms // to the format specified in IRCv3.2 tags. - if (tagname[0] != '+' || tagname.length() < 2) + if (tagname[0] != '+' || tagname.length() < 2 || !allowclientonlytags) return MOD_RES_PASSTHRU; // If the user is local then we check whether they have the message-tags cap @@ -324,6 +325,11 @@ class ModuleIRCv3CTCTags { } + void ReadConfig(ConfigStatus& status) override + { + c2ctags.allowclientonlytags = ServerInstance->Config->ConfValue("ctctags")->getBool("allowclientonlytags", true); + } + ModResult OnUserPreMessage(User* user, const MessageTarget& target, MessageDetails& details) override { return CopyClientTags(details.tags_in, details.tags_out); diff --git a/src/modules/m_ircv3_msgid.cpp b/src/modules/m_ircv3_msgid.cpp index d28b8e0d1..6033bb888 100644 --- a/src/modules/m_ircv3_msgid.cpp +++ b/src/modules/m_ircv3_msgid.cpp @@ -1,7 +1,7 @@ /* * InspIRCd -- Internet Relay Chat Daemon * - * Copyright (C) 2019 Sadie Powell <sadie@witchery.services> + * Copyright (C) 2019-2020 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/src/modules/m_ircv3_sts.cpp b/src/modules/m_ircv3_sts.cpp index 09724db99..5eec16944 100644 --- a/src/modules/m_ircv3_sts.cpp +++ b/src/modules/m_ircv3_sts.cpp @@ -1,7 +1,8 @@ /* * InspIRCd -- Internet Relay Chat Daemon * - * Copyright (C) 2017-2019 Sadie Powell <sadie@witchery.services> + * Copyright (C) 2020 Matt Schatz <genius3000@g3k.solutions> + * Copyright (C) 2017-2020 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/src/modules/m_kicknorejoin.cpp b/src/modules/m_kicknorejoin.cpp index de3c0b8d9..99aadebe3 100644 --- a/src/modules/m_kicknorejoin.cpp +++ b/src/modules/m_kicknorejoin.cpp @@ -3,7 +3,7 @@ * * Copyright (C) 2018 A_D <A-UNDERSCORE-D@users.noreply.github.com> * Copyright (C) 2014 Daniel Vassdal <shutter@canternet.org> - * Copyright (C) 2013, 2017-2019 Sadie Powell <sadie@witchery.services> + * Copyright (C) 2013, 2017-2020 Sadie Powell <sadie@witchery.services> * Copyright (C) 2012-2015 Attila Molnar <attilamolnar@hush.com> * Copyright (C) 2012, 2019 Robby <robby@chatbelgie.be> * Copyright (C) 2009 Uli Schlachter <psychon@inspircd.org> diff --git a/src/modules/m_ldapauth.cpp b/src/modules/m_ldapauth.cpp index e1c7b67b0..1dd7bac75 100644 --- a/src/modules/m_ldapauth.cpp +++ b/src/modules/m_ldapauth.cpp @@ -1,6 +1,7 @@ /* * InspIRCd -- Internet Relay Chat Daemon * + * Copyright (C) 2020 Joel Sing <joel@sing.id.au> * Copyright (C) 2019 Sadie Powell <sadie@witchery.services> * Copyright (C) 2019 Robby <robby@chatbelgie.be> * Copyright (C) 2014-2015 Attila Molnar <attilamolnar@hush.com> diff --git a/src/modules/m_ldapoper.cpp b/src/modules/m_ldapoper.cpp index f7efffb1e..1a6a70528 100644 --- a/src/modules/m_ldapoper.cpp +++ b/src/modules/m_ldapoper.cpp @@ -1,7 +1,7 @@ /* * InspIRCd -- Internet Relay Chat Daemon * - * Copyright (C) 2017-2019 Sadie Powell <sadie@witchery.services> + * Copyright (C) 2017-2020 Sadie Powell <sadie@witchery.services> * Copyright (C) 2014, 2018 Attila Molnar <attilamolnar@hush.com> * Copyright (C) 2013-2014 Adam <Adam@anope.org> * @@ -150,7 +150,13 @@ class AdminBindInterface : public LDAPInterface public: AdminBindInterface(Module* c, const std::string& p, const std::string& u, const std::string& o, const std::string& pa, const std::string& b, const std::string& w) - : LDAPInterface(c), provider(p), user(u), opername(p), password(pa), base(b), what(w) + : LDAPInterface(c) + , provider(p) + , user(u) + , opername(o) + , password(pa) + , base(b) + , what(w) { } diff --git a/src/modules/m_muteban.cpp b/src/modules/m_muteban.cpp index f06efdb96..6d8f1a678 100644 --- a/src/modules/m_muteban.cpp +++ b/src/modules/m_muteban.cpp @@ -1,8 +1,7 @@ /* * InspIRCd -- Internet Relay Chat Daemon * - * Copyright (C) 2016 Attila Molnar <attilamolnar@hush.com> - * Copyright (C) 2013, 2017, 2019 Sadie Powell <sadie@witchery.services> + * Copyright (C) 2013, 2017, 2019-2020 Sadie Powell <sadie@witchery.services> * Copyright (C) 2012, 2018-2019 Robby <robby@chatbelgie.be> * Copyright (C) 2009 Uli Schlachter <psychon@inspircd.org> * Copyright (C) 2009 Daniel De Graaf <danieldg@inspircd.org> diff --git a/src/modules/m_noctcp.cpp b/src/modules/m_noctcp.cpp index fc2285c0b..3c1b7146e 100644 --- a/src/modules/m_noctcp.cpp +++ b/src/modules/m_noctcp.cpp @@ -3,7 +3,7 @@ * * Copyright (C) 2019 linuxdaemon <linuxdaemon.irc@gmail.com> * Copyright (C) 2019 Matt Schatz <genius3000@g3k.solutions> - * Copyright (C) 2013, 2017-2018 Sadie Powell <sadie@witchery.services> + * Copyright (C) 2013, 2017-2018, 2020 Sadie Powell <sadie@witchery.services> * Copyright (C) 2012, 2019 Robby <robby@chatbelgie.be> * Copyright (C) 2012 Attila Molnar <attilamolnar@hush.com> * Copyright (C) 2009 Uli Schlachter <psychon@inspircd.org> diff --git a/src/modules/m_nonotice.cpp b/src/modules/m_nonotice.cpp index 3fd330fe5..9041c9932 100644 --- a/src/modules/m_nonotice.cpp +++ b/src/modules/m_nonotice.cpp @@ -2,7 +2,7 @@ * InspIRCd -- Internet Relay Chat Daemon * * Copyright (C) 2019 Matt Schatz <genius3000@g3k.solutions> - * Copyright (C) 2013, 2017 Sadie Powell <sadie@witchery.services> + * Copyright (C) 2013, 2017, 2020 Sadie Powell <sadie@witchery.services> * Copyright (C) 2012 Shawn Smith <ShawnSmith0828@gmail.com> * Copyright (C) 2012 Robby <robby@chatbelgie.be> * Copyright (C) 2012 Attila Molnar <attilamolnar@hush.com> diff --git a/src/modules/m_operlog.cpp b/src/modules/m_operlog.cpp index 2d5bec647..da1d1b462 100644 --- a/src/modules/m_operlog.cpp +++ b/src/modules/m_operlog.cpp @@ -1,7 +1,7 @@ /* * InspIRCd -- Internet Relay Chat Daemon * - * Copyright (C) 2013, 2018-2019 Sadie Powell <sadie@witchery.services> + * Copyright (C) 2013, 2018-2020 Sadie Powell <sadie@witchery.services> * Copyright (C) 2012-2014 Attila Molnar <attilamolnar@hush.com> * Copyright (C) 2012, 2019 Robby <robby@chatbelgie.be> * Copyright (C) 2009-2010 Daniel De Graaf <danieldg@inspircd.org> diff --git a/src/modules/m_passforward.cpp b/src/modules/m_passforward.cpp index 5ff923638..57f63ed30 100644 --- a/src/modules/m_passforward.cpp +++ b/src/modules/m_passforward.cpp @@ -3,7 +3,7 @@ * * Copyright (C) 2019 linuxdaemon <linuxdaemon.irc@gmail.com> * Copyright (C) 2014 Googolplexed <googol@googolplexed.net> - * Copyright (C) 2013, 2018-2019 Sadie Powell <sadie@witchery.services> + * Copyright (C) 2013, 2018, 2020 Sadie Powell <sadie@witchery.services> * Copyright (C) 2012-2014, 2018 Attila Molnar <attilamolnar@hush.com> * Copyright (C) 2012 Robby <robby@chatbelgie.be> * Copyright (C) 2012 Boleslaw Tokarski <boleslaw.tokarski@tieto.com> diff --git a/src/modules/m_permchannels.cpp b/src/modules/m_permchannels.cpp index 861fe18eb..8353a5b00 100644 --- a/src/modules/m_permchannels.cpp +++ b/src/modules/m_permchannels.cpp @@ -54,7 +54,7 @@ class PermChannel : public ModeHandler } }; -// Not in a class due to circular dependancy hell. +// Not in a class due to circular dependency hell. static std::string permchannelsconf; static bool WriteDatabase(PermChannel& permchanmode, Module* mod, bool save_listmodes) { @@ -152,7 +152,7 @@ static bool WriteDatabase(PermChannel& permchanmode, Module* mod, bool save_list #ifdef _WIN32 remove(permchannelsconf.c_str()); #endif - // Use rename to move temporary to new db - this is guarenteed not to fuck up, even in case of a crash. + // Use rename to move temporary to new db - this is guaranteed not to fuck up, even in case of a crash. if (rename(permchannelsnewconf.c_str(), permchannelsconf.c_str()) < 0) { ServerInstance->Logs.Log(MODNAME, LOG_DEFAULT, "Cannot replace old database \"%s\" with new database \"%s\"! %s (%d)", permchannelsconf.c_str(), permchannelsnewconf.c_str(), strerror(errno), errno); diff --git a/src/modules/m_randquote.cpp b/src/modules/m_randquote.cpp index 3832a907f..743a67227 100644 --- a/src/modules/m_randquote.cpp +++ b/src/modules/m_randquote.cpp @@ -1,7 +1,7 @@ /* * InspIRCd -- Internet Relay Chat Daemon * - * Copyright (C) 2013 Sadie Powell <sadie@witchery.services> + * Copyright (C) 2013, 2020 Sadie Powell <sadie@witchery.services> * Copyright (C) 2012, 2019 Robby <robby@chatbelgie.be> * Copyright (C) 2010 Daniel De Graaf <danieldg@inspircd.org> * Copyright (C) 2009 Uli Schlachter <psychon@inspircd.org> diff --git a/src/modules/m_regex_stdlib.cpp b/src/modules/m_regex_stdlib.cpp index 57198b495..08ec030b9 100644 --- a/src/modules/m_regex_stdlib.cpp +++ b/src/modules/m_regex_stdlib.cpp @@ -2,7 +2,7 @@ * InspIRCd -- Internet Relay Chat Daemon * * Copyright (C) 2019 Robby <robby@chatbelgie.be> - * Copyright (C) 2013, 2016, 2018 Sadie Powell <sadie@witchery.services> + * Copyright (C) 2013, 2016, 2018, 2020 Sadie Powell <sadie@witchery.services> * Copyright (C) 2013 Attila Molnar <attilamolnar@hush.com> * Copyright (C) 2012 ChrisTX <xpipe@hotmail.de> * diff --git a/src/modules/m_restrictchans.cpp b/src/modules/m_restrictchans.cpp index 2b06c73a2..6bc2c13dd 100644 --- a/src/modules/m_restrictchans.cpp +++ b/src/modules/m_restrictchans.cpp @@ -2,7 +2,7 @@ * InspIRCd -- Internet Relay Chat Daemon * * Copyright (C) 2018-2019 linuxdaemon <linuxdaemon.irc@gmail.com> - * Copyright (C) 2013 Sadie Powell <sadie@witchery.services> + * Copyright (C) 2013, 2020 Sadie Powell <sadie@witchery.services> * 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/src/modules/m_restrictmsg.cpp b/src/modules/m_restrictmsg.cpp index 3d6c5f5ec..ffa9a057d 100644 --- a/src/modules/m_restrictmsg.cpp +++ b/src/modules/m_restrictmsg.cpp @@ -1,8 +1,8 @@ /* * InspIRCd -- Internet Relay Chat Daemon * - * Copyright (C) 2015-2016 Attila Molnar <attilamolnar@hush.com> - * Copyright (C) 2013, 2015, 2017, 2019 Sadie Powell <sadie@witchery.services> + * Copyright (C) 2015 Attila Molnar <attilamolnar@hush.com> + * Copyright (C) 2013, 2015, 2017, 2019-2020 Sadie Powell <sadie@witchery.services> * Copyright (C) 2012, 2019 Robby <robby@chatbelgie.be> * Copyright (C) 2009 Daniel De Graaf <danieldg@inspircd.org> * Copyright (C) 2008 Robin Burchell <robin+git@viroteck.net> diff --git a/src/modules/m_rline.cpp b/src/modules/m_rline.cpp index 5cfefb692..ce271df23 100644 --- a/src/modules/m_rline.cpp +++ b/src/modules/m_rline.cpp @@ -3,7 +3,7 @@ * * Copyright (C) 2018 linuxdaemon <linuxdaemon.irc@gmail.com> * Copyright (C) 2017, 2019 Matt Schatz <genius3000@g3k.solutions> - * Copyright (C) 2013, 2017-2018 Sadie Powell <sadie@witchery.services> + * Copyright (C) 2013, 2017-2018, 2020 Sadie Powell <sadie@witchery.services> * Copyright (C) 2012-2013, 2016 Attila Molnar <attilamolnar@hush.com> * Copyright (C) 2012, 2018-2019 Robby <robby@chatbelgie.be> * Copyright (C) 2009-2010 Daniel De Graaf <danieldg@inspircd.org> diff --git a/src/modules/m_sajoin.cpp b/src/modules/m_sajoin.cpp index 3348b3c03..f79c82592 100644 --- a/src/modules/m_sajoin.cpp +++ b/src/modules/m_sajoin.cpp @@ -1,7 +1,7 @@ /* * InspIRCd -- Internet Relay Chat Daemon * - * Copyright (C) 2013, 2018-2019 Sadie Powell <sadie@witchery.services> + * Copyright (C) 2013, 2018-2020 Sadie Powell <sadie@witchery.services> * Copyright (C) 2013 Daniel Vassdal <shutter@canternet.org> * Copyright (C) 2012-2014, 2016 Attila Molnar <attilamolnar@hush.com> * Copyright (C) 2012, 2019 Robby <robby@chatbelgie.be> diff --git a/src/modules/m_sakick.cpp b/src/modules/m_sakick.cpp index 708eca75a..0bb69c7e8 100644 --- a/src/modules/m_sakick.cpp +++ b/src/modules/m_sakick.cpp @@ -1,7 +1,7 @@ /* * InspIRCd -- Internet Relay Chat Daemon * - * Copyright (C) 2013, 2018 Sadie Powell <sadie@witchery.services> + * Copyright (C) 2013, 2018, 2020 Sadie Powell <sadie@witchery.services> * Copyright (C) 2012-2014, 2016 Attila Molnar <attilamolnar@hush.com> * Copyright (C) 2012, 2019 Robby <robby@chatbelgie.be> * Copyright (C) 2010 Craig Edwards <brain@inspircd.org> diff --git a/src/modules/m_samode.cpp b/src/modules/m_samode.cpp index 96ddf5400..6dd793c0a 100644 --- a/src/modules/m_samode.cpp +++ b/src/modules/m_samode.cpp @@ -1,7 +1,7 @@ /* * InspIRCd -- Internet Relay Chat Daemon * - * Copyright (C) 2013, 2017-2019 Sadie Powell <sadie@witchery.services> + * Copyright (C) 2013, 2017-2020 Sadie Powell <sadie@witchery.services> * Copyright (C) 2013 Daniel Vassdal <shutter@canternet.org> * Copyright (C) 2012-2016, 2018 Attila Molnar <attilamolnar@hush.com> * Copyright (C) 2012, 2019 Robby <robby@chatbelgie.be> diff --git a/src/modules/m_sanick.cpp b/src/modules/m_sanick.cpp index acf177e7b..571437289 100644 --- a/src/modules/m_sanick.cpp +++ b/src/modules/m_sanick.cpp @@ -1,7 +1,7 @@ /* * InspIRCd -- Internet Relay Chat Daemon * - * Copyright (C) 2013, 2018 Sadie Powell <sadie@witchery.services> + * Copyright (C) 2013, 2018, 2020 Sadie Powell <sadie@witchery.services> * Copyright (C) 2012-2014, 2016 Attila Molnar <attilamolnar@hush.com> * Copyright (C) 2012, 2019 Robby <robby@chatbelgie.be> * Copyright (C) 2010 Craig Edwards <brain@inspircd.org> diff --git a/src/modules/m_sapart.cpp b/src/modules/m_sapart.cpp index 538b75e21..10c73cd6a 100644 --- a/src/modules/m_sapart.cpp +++ b/src/modules/m_sapart.cpp @@ -1,7 +1,7 @@ /* * InspIRCd -- Internet Relay Chat Daemon * - * Copyright (C) 2013, 2018 Sadie Powell <sadie@witchery.services> + * Copyright (C) 2013, 2018, 2020 Sadie Powell <sadie@witchery.services> * Copyright (C) 2012-2014, 2016 Attila Molnar <attilamolnar@hush.com> * Copyright (C) 2012, 2019 Robby <robby@chatbelgie.be> * Copyright (C) 2009 Daniel De Graaf <danieldg@inspircd.org> diff --git a/src/modules/m_saquit.cpp b/src/modules/m_saquit.cpp index 5723ad6a7..ec4a0ed5c 100644 --- a/src/modules/m_saquit.cpp +++ b/src/modules/m_saquit.cpp @@ -1,7 +1,7 @@ /* * InspIRCd -- Internet Relay Chat Daemon * - * Copyright (C) 2013, 2018 Sadie Powell <sadie@witchery.services> + * Copyright (C) 2013, 2018, 2020 Sadie Powell <sadie@witchery.services> * Copyright (C) 2012-2016 Attila Molnar <attilamolnar@hush.com> * Copyright (C) 2012, 2019 Robby <robby@chatbelgie.be> * Copyright (C) 2009 Thomas Stagner <aquanight@inspircd.org> diff --git a/src/modules/m_sasl.cpp b/src/modules/m_sasl.cpp index 26efc6c51..5b7ef0fb8 100644 --- a/src/modules/m_sasl.cpp +++ b/src/modules/m_sasl.cpp @@ -4,7 +4,7 @@ * Copyright (C) 2016 Adam <Adam@anope.org> * Copyright (C) 2014 Mantas Mikulėnas <grawity@gmail.com> * Copyright (C) 2013-2016, 2018 Attila Molnar <attilamolnar@hush.com> - * Copyright (C) 2013, 2017-2019 Sadie Powell <sadie@witchery.services> + * Copyright (C) 2013, 2017-2020 Sadie Powell <sadie@witchery.services> * Copyright (C) 2013 Daniel Vassdal <shutter@canternet.org> * Copyright (C) 2012, 2019 Robby <robby@chatbelgie.be> * Copyright (C) 2009-2010 Daniel De Graaf <danieldg@inspircd.org> diff --git a/src/modules/m_satopic.cpp b/src/modules/m_satopic.cpp index 73cabfbd6..1c4ad4b82 100644 --- a/src/modules/m_satopic.cpp +++ b/src/modules/m_satopic.cpp @@ -2,7 +2,7 @@ * InspIRCd -- Internet Relay Chat Daemon * * Copyright (C) 2017 B00mX0r <b00mx0r@aureus.pw> - * Copyright (C) 2013, 2018 Sadie Powell <sadie@witchery.services> + * Copyright (C) 2013, 2018, 2020 Sadie Powell <sadie@witchery.services> * Copyright (C) 2012, 2019 Robby <robby@chatbelgie.be> * Copyright (C) 2012, 2016 Attila Molnar <attilamolnar@hush.com> * Copyright (C) 2009 Uli Schlachter <psychon@inspircd.org> diff --git a/src/modules/m_securelist.cpp b/src/modules/m_securelist.cpp index 74ded860f..cb9a04f48 100644 --- a/src/modules/m_securelist.cpp +++ b/src/modules/m_securelist.cpp @@ -2,7 +2,7 @@ * InspIRCd -- Internet Relay Chat Daemon * * Copyright (C) 2018 linuxdaemon <linuxdaemon.irc@gmail.com> - * Copyright (C) 2013, 2018 Sadie Powell <sadie@witchery.services> + * Copyright (C) 2013, 2018, 2020 Sadie Powell <sadie@witchery.services> * Copyright (C) 2012-2013, 2016 Attila Molnar <attilamolnar@hush.com> * Copyright (C) 2012, 2019 Robby <robby@chatbelgie.be> * Copyright (C) 2009 Daniel De Graaf <danieldg@inspircd.org> @@ -37,6 +37,7 @@ class ModuleSecureList private: AllowList allowlist; bool exemptregistered; + bool showmsg; unsigned int WaitTime; public: @@ -61,24 +62,20 @@ class ModuleSecureList } ConfigTag* tag = ServerInstance->Config->ConfValue("securelist"); - exemptregistered = tag->getBool("exemptregistered"); + showmsg = tag->getBool("showmsg", true); WaitTime = tag->getDuration("waittime", 60, 1); allowlist.swap(newallows); } - - /* - * OnPreCommand() - * Intercept the LIST command. - */ ModResult OnPreCommand(std::string& command, CommandBase::Params& parameters, LocalUser* user, bool validated) override { /* If the command doesnt appear to be valid, we dont want to mess with it. */ if (!validated) return MOD_RES_PASSTHRU; - if ((command == "LIST") && (ServerInstance->Time() < (user->signon+WaitTime)) && (!user->IsOper())) + time_t waitallowed = user->signon + WaitTime; + if ((command == "LIST") && (ServerInstance->Time() < waitallowed) && (!user->IsOper())) { /* Normally wouldnt be allowed here, are they exempt? */ for (std::vector<std::string>::iterator x = allowlist.begin(); x != allowlist.end(); x++) @@ -89,11 +86,15 @@ class ModuleSecureList if (exemptregistered && ext && ext->get(user)) return MOD_RES_PASSTHRU; - /* Not exempt, BOOK EM DANNO! */ - user->WriteNotice("*** You cannot list within the first " + ConvToStr(WaitTime) + " seconds of connecting. Please try again later."); - /* Some clients (e.g. mIRC, various java chat applets) muck up if they don't - * receive these numerics whenever they send LIST, so give them an empty LIST to mull over. - */ + if (showmsg) + { + user->WriteNotice(InspIRCd::Format("*** You cannot view the channel list right now. Please %stry again in %s.", + (exemptregistered ? "login to an account or " : ""), + InspIRCd::DurationString(waitallowed - ServerInstance->Time()).c_str())); + } + + // The client might be waiting on a response to do something so send them an + // empty list response to satisfy that. user->WriteNumeric(RPL_LISTSTART, "Channel", "Users Name"); user->WriteNumeric(RPL_LISTEND, "End of channel list."); return MOD_RES_DENY; @@ -103,7 +104,8 @@ class ModuleSecureList void OnBuildISupport(ISupport::TokenMap& tokens) override { - tokens["SECURELIST"]; + if (showmsg) + tokens["SECURELIST"] = ConvToStr(WaitTime); } }; diff --git a/src/modules/m_servprotect.cpp b/src/modules/m_servprotect.cpp index 8ae2784c6..fa92d9947 100644 --- a/src/modules/m_servprotect.cpp +++ b/src/modules/m_servprotect.cpp @@ -1,9 +1,9 @@ /* * InspIRCd -- Internet Relay Chat Daemon * - * Copyright (C) 2013, 2017-2018 Sadie Powell <sadie@witchery.services> + * Copyright (C) 2013, 2017-2018, 2020 Sadie Powell <sadie@witchery.services> * Copyright (C) 2012-2016 Attila Molnar <attilamolnar@hush.com> - * Copyright (C) 2012, 2019 Robby <robby@chatbelgie.be> + * Copyright (C) 2012 Robby <robby@chatbelgie.be> * Copyright (C) 2009 Daniel De Graaf <danieldg@inspircd.org> * Copyright (C) 2008, 2010 Craig Edwards <brain@inspircd.org> * Copyright (C) 2007-2008 Robin Burchell <robin+git@viroteck.net> diff --git a/src/modules/m_sethost.cpp b/src/modules/m_sethost.cpp index 2d0ff6b03..6f4e8a8dc 100644 --- a/src/modules/m_sethost.cpp +++ b/src/modules/m_sethost.cpp @@ -1,7 +1,7 @@ /* * InspIRCd -- Internet Relay Chat Daemon * - * Copyright (C) 2013, 2017-2018 Sadie Powell <sadie@witchery.services> + * Copyright (C) 2013, 2017-2018, 2020 Sadie Powell <sadie@witchery.services> * Copyright (C) 2012-2013 Attila Molnar <attilamolnar@hush.com> * Copyright (C) 2012, 2019 Robby <robby@chatbelgie.be> * Copyright (C) 2009 Daniel De Graaf <danieldg@inspircd.org> diff --git a/src/modules/m_setident.cpp b/src/modules/m_setident.cpp index d5c17ad2b..f85ca1f0a 100644 --- a/src/modules/m_setident.cpp +++ b/src/modules/m_setident.cpp @@ -1,7 +1,7 @@ /* * InspIRCd -- Internet Relay Chat Daemon * - * Copyright (C) 2013, 2018 Sadie Powell <sadie@witchery.services> + * Copyright (C) 2013, 2018, 2020 Sadie Powell <sadie@witchery.services> * Copyright (C) 2012-2013 Attila Molnar <attilamolnar@hush.com> * Copyright (C) 2012, 2019 Robby <robby@chatbelgie.be> * Copyright (C) 2009 Uli Schlachter <psychon@inspircd.org> diff --git a/src/modules/m_setidle.cpp b/src/modules/m_setidle.cpp index e06b7d629..c93bd1da7 100644 --- a/src/modules/m_setidle.cpp +++ b/src/modules/m_setidle.cpp @@ -2,7 +2,7 @@ * InspIRCd -- Internet Relay Chat Daemon * * Copyright (C) 2018 linuxdaemon <linuxdaemon.irc@gmail.com> - * Copyright (C) 2013, 2017-2018 Sadie Powell <sadie@witchery.services> + * Copyright (C) 2013, 2017-2018, 2020 Sadie Powell <sadie@witchery.services> * Copyright (C) 2012-2013 Attila Molnar <attilamolnar@hush.com> * Copyright (C) 2012, 2019 Robby <robby@chatbelgie.be> * Copyright (C) 2010 Craig Edwards <brain@inspircd.org> diff --git a/src/modules/m_setname.cpp b/src/modules/m_setname.cpp index e6d933ee4..c2de21045 100644 --- a/src/modules/m_setname.cpp +++ b/src/modules/m_setname.cpp @@ -1,13 +1,11 @@ /* * InspIRCd -- Internet Relay Chat Daemon * - * Copyright (C) 2018 Matt Schatz <genius3000@g3k.solutions> - * Copyright (C) 2013, 2018-2019 Sadie Powell <sadie@witchery.services> + * Copyright (C) 2013, 2018-2020 Sadie Powell <sadie@witchery.services> * Copyright (C) 2012, 2019 Robby <robby@chatbelgie.be> * Copyright (C) 2012 Attila Molnar <attilamolnar@hush.com> * Copyright (C) 2010 Craig Edwards <brain@inspircd.org> * Copyright (C) 2009 Daniel De Graaf <danieldg@inspircd.org> - * Copyright (C) 2007 Robin Burchell <robin+git@viroteck.net> * Copyright (C) 2007 John Brooks <special@inspircd.org> * Copyright (C) 2007 Dennis Friis <peavey@inspircd.org> * diff --git a/src/modules/m_shun.cpp b/src/modules/m_shun.cpp index 5b9e91a69..bf6a0e5d0 100644 --- a/src/modules/m_shun.cpp +++ b/src/modules/m_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-2018 B00mX0r <b00mx0r@aureus.pw> - * Copyright (C) 2013, 2017-2018 Sadie Powell <sadie@witchery.services> + * Copyright (C) 2013, 2017-2018, 2020 Sadie Powell <sadie@witchery.services> * Copyright (C) 2012-2016 Attila Molnar <attilamolnar@hush.com> * Copyright (C) 2012, 2018-2019 Robby <robby@chatbelgie.be> * Copyright (C) 2012 Jens Voss <DukePyrolator@anope.org> @@ -159,6 +159,16 @@ class ModuleShun : public Module, public Stats::EventListener insp::flat_set<std::string> ShunEnabledCommands; bool NotifyOfShun; + bool IsShunned(LocalUser* user) + { + // Exempt the user from shuns if they are an oper with the servers/ignore-shun privilege. + if (user->HasPrivPermission("servers/ignore-shun")) + return false; + + // Check whether the user is actually shunned. + return ServerInstance->XLines->MatchesLine("SHUN", user); + } + public: ModuleShun() : Module(VF_VENDOR | VF_COMMON, "Adds the /SHUN command which allows server operators to prevent users from executing commands.") @@ -210,14 +220,10 @@ class ModuleShun : public Module, public Stats::EventListener ModResult OnPreCommand(std::string& command, CommandBase::Params& parameters, LocalUser* user, bool validated) override { - if (validated) - return MOD_RES_PASSTHRU; - - // Exempt the user from shuns if they have the servers/ignore-shun privilege. - if (user->HasPrivPermission("servers/ignore-shun")) + if (validated || !IsShunned(user)) return MOD_RES_PASSTHRU; - if (ServerInstance->XLines->MatchesLine("SHUN", user) && !ShunEnabledCommands.count(command)) + if (!ShunEnabledCommands.count(command)) { if (NotifyOfShun) user->WriteNotice("*** Command " + command + " not processed, as you have been blocked from issuing commands (SHUN)"); diff --git a/src/modules/m_spanningtree/capab.cpp b/src/modules/m_spanningtree/capab.cpp index f2d636b73..68e08e254 100644 --- a/src/modules/m_spanningtree/capab.cpp +++ b/src/modules/m_spanningtree/capab.cpp @@ -188,7 +188,7 @@ void TreeSocket::SendCapabilities(int phase) this->WriteLine("CAPAB END"); } -/* Isolate and return the elements that are different between two comma seperated lists */ +/* Isolate and return the elements that are different between two comma separated lists */ void TreeSocket::ListDifference(const std::string &one, const std::string &two, char sep, std::string& mleft, std::string& mright) { diff --git a/src/modules/m_spanningtree/commands.h b/src/modules/m_spanningtree/commands.h index 398818ae2..f2e0e8d8a 100644 --- a/src/modules/m_spanningtree/commands.h +++ b/src/modules/m_spanningtree/commands.h @@ -139,7 +139,7 @@ class FwdFJoinBuilder; class CommandFJoin : public ServerCommand { /** Remove all modes from a channel, including statusmodes (+qaovh etc), simplemodes, parameter modes. - * This does not update the timestamp of the target channel, this must be done seperately. + * This does not update the timestamp of the target channel, this must be done separately. */ static void RemoveStatus(Channel* c); diff --git a/src/modules/m_spanningtree/ftopic.cpp b/src/modules/m_spanningtree/ftopic.cpp index aa669ce49..2f9813860 100644 --- a/src/modules/m_spanningtree/ftopic.cpp +++ b/src/modules/m_spanningtree/ftopic.cpp @@ -50,7 +50,7 @@ CmdResult CommandFTopic::Handle(User* user, Params& params) /* * If the topics were updated at the exact same second, accept * the remote only when it's "bigger" than ours as defined by - * string comparision, so non-empty topics always overridde + * string comparison, so non-empty topics always overridde * empty topics if their timestamps are equal * * Similarly, if the topic texts are equal too, keep one topic diff --git a/src/modules/m_spanningtree/main.cpp b/src/modules/m_spanningtree/main.cpp index 306e4b7ee..6ef89e62b 100644 --- a/src/modules/m_spanningtree/main.cpp +++ b/src/modules/m_spanningtree/main.cpp @@ -1,6 +1,7 @@ /* * InspIRCd -- Internet Relay Chat Daemon * + * Copyright (C) 2020 Matt Schatz <genius3000@g3k.solutions> * Copyright (C) 2019 linuxdaemon <linuxdaemon.irc@gmail.com> * Copyright (C) 2013, 2017-2020 Sadie Powell <sadie@witchery.services> * Copyright (C) 2013, 2016 Adam <Adam@anope.org> @@ -134,7 +135,7 @@ void ModuleSpanningTree::ShowLinks(TreeServer* Current, User* user, int hops) ShowLinks(server, user, hops+1); } } - /* Don't display the line if its a uline, hide ulines is on, and the user isnt an oper */ + /* Don't display the line if its a uline, hide ulines is on, and the user isn't an oper */ if ((Utils->HideULines) && (Current->IsULine()) && (!user->IsOper())) return; /* Or if the server is hidden and they're not an oper */ diff --git a/src/modules/m_spanningtree/main.h b/src/modules/m_spanningtree/main.h index 0a8be639b..915ce8e0f 100644 --- a/src/modules/m_spanningtree/main.h +++ b/src/modules/m_spanningtree/main.h @@ -168,7 +168,7 @@ class ModuleSpanningTree */ void DoConnectTimeout(time_t curtime); - /** Handle remote VERSON + /** Handle remote VERSION */ ModResult HandleVersion(const CommandBase::Params& parameters, User* user); diff --git a/src/modules/m_spanningtree/override_map.cpp b/src/modules/m_spanningtree/override_map.cpp index b5caa63e8..07df47e47 100644 --- a/src/modules/m_spanningtree/override_map.cpp +++ b/src/modules/m_spanningtree/override_map.cpp @@ -144,10 +144,10 @@ static std::vector<std::string> GetMap(User* user, TreeServer* current, unsigned if (j != child_map.begin()) { // If this child is not my last child, then add | - // to be able to "link" the next server in my list to me, and to indent this childs servers + // to be able to "link" the next server in my list to me, and to indent this children servers if (!last) prefix = "| "; - // Otherwise this is my last child, so just use a space as theres nothing else linked to me below this + // Otherwise this is my last child, so just use a space as there's nothing else linked to me below this else prefix = " "; } diff --git a/src/modules/m_spanningtree/resolvers.cpp b/src/modules/m_spanningtree/resolvers.cpp index 7085fa278..82c36918d 100644 --- a/src/modules/m_spanningtree/resolvers.cpp +++ b/src/modules/m_spanningtree/resolvers.cpp @@ -1,7 +1,7 @@ /* * InspIRCd -- Internet Relay Chat Daemon * - * Copyright (C) 2013, 2019 Sadie Powell <sadie@witchery.services> + * Copyright (C) 2013, 2019-2020 Sadie Powell <sadie@witchery.services> * Copyright (C) 2013, 2016 Adam <Adam@anope.org> * Copyright (C) 2012-2014, 2016 Attila Molnar <attilamolnar@hush.com> * Copyright (C) 2012 Robby <robby@chatbelgie.be> @@ -35,7 +35,7 @@ #include "treesocket.h" /** This class is used to resolve server hostnames during /connect and autoconnect. - * As of 1.1, the resolver system is seperated out from BufferedSocket, so we must do this + * As of 1.1, the resolver system is separated out from BufferedSocket, so we must do this * resolver step first ourselves if we need it. This is totally nonblocking, and will * callback to OnLookupComplete or OnError when completed. Once it has completed we * will have an IP address which we can then use to continue our connection. diff --git a/src/modules/m_spanningtree/resolvers.h b/src/modules/m_spanningtree/resolvers.h index 345b51c7c..1c6f098e1 100644 --- a/src/modules/m_spanningtree/resolvers.h +++ b/src/modules/m_spanningtree/resolvers.h @@ -7,7 +7,6 @@ * Copyright (C) 2012 Robby <robby@chatbelgie.be> * Copyright (C) 2009 Daniel De Graaf <danieldg@inspircd.org> * Copyright (C) 2007, 2010 Craig Edwards <brain@inspircd.org> - * Copyright (C) 2007 Robin Burchell <robin+git@viroteck.net> * Copyright (C) 2007 Dennis Friis <peavey@inspircd.org> * * This file is part of InspIRCd. InspIRCd is free software: you can @@ -48,7 +47,7 @@ class SecurityIPResolver : public DNS::Request }; /** This class is used to resolve server hostnames during /connect and autoconnect. - * As of 1.1, the resolver system is seperated out from BufferedSocket, so we must do this + * As of 1.1, the resolver system is separated out from BufferedSocket, so we must do this * resolver step first ourselves if we need it. This is totally nonblocking, and will * callback to OnLookupComplete or OnError when completed. Once it has completed we * will have an IP address which we can then use to continue our connection. diff --git a/src/modules/m_spanningtree/tags.cpp b/src/modules/m_spanningtree/tags.cpp index 7ae26d45b..4accf53bd 100644 --- a/src/modules/m_spanningtree/tags.cpp +++ b/src/modules/m_spanningtree/tags.cpp @@ -1,7 +1,7 @@ /* * InspIRCd -- Internet Relay Chat Daemon * - * Copyright (C) 2019 Sadie Powell <sadie@witchery.services> + * Copyright (C) 2019-2020 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/src/modules/m_spanningtree/tags.h b/src/modules/m_spanningtree/tags.h index 6f2f68762..1f402b597 100644 --- a/src/modules/m_spanningtree/tags.h +++ b/src/modules/m_spanningtree/tags.h @@ -1,7 +1,7 @@ /* * InspIRCd -- Internet Relay Chat Daemon * - * Copyright (C) 2019 Sadie Powell <sadie@witchery.services> + * Copyright (C) 2019-2020 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/src/modules/m_spanningtree/treeserver.cpp b/src/modules/m_spanningtree/treeserver.cpp index 48bedb839..138ba01f0 100644 --- a/src/modules/m_spanningtree/treeserver.cpp +++ b/src/modules/m_spanningtree/treeserver.cpp @@ -119,7 +119,7 @@ TreeServer::TreeServer(const std::string& Name, const std::string& Desc, const s * be referenced by its server name. The AddHashEntry() * call below automatically inserts each TreeServer class * into the hash_map as it is created. There is a similar - * maintainance call in the destructor to tidy up deleted + * maintenance call in the destructor to tidy up deleted * servers. */ diff --git a/src/modules/m_spanningtree/treesocket2.cpp b/src/modules/m_spanningtree/treesocket2.cpp index 1afc7f1ab..91762a43d 100644 --- a/src/modules/m_spanningtree/treesocket2.cpp +++ b/src/modules/m_spanningtree/treesocket2.cpp @@ -2,7 +2,7 @@ * InspIRCd -- Internet Relay Chat Daemon * * Copyright (C) 2019 linuxdaemon <linuxdaemon.irc@gmail.com> - * Copyright (C) 2013, 2018-2019 Sadie Powell <sadie@witchery.services> + * Copyright (C) 2013, 2018-2020 Sadie Powell <sadie@witchery.services> * Copyright (C) 2013 Adam <Adam@anope.org> * Copyright (C) 2012-2016 Attila Molnar <attilamolnar@hush.com> * Copyright (C) 2012, 2019 Robby <robby@chatbelgie.be> @@ -416,7 +416,7 @@ void TreeSocket::Close() // Connection closed. // If the connection is fully up (state CONNECTED) - // then propogate a netsplit to all peers. + // then propagate a netsplit to all peers. if (MyRoot) MyRoot->SQuit(getError(), true); diff --git a/src/modules/m_spanningtree/uid.cpp b/src/modules/m_spanningtree/uid.cpp index 3a6aab11b..85ce2dd5f 100644 --- a/src/modules/m_spanningtree/uid.cpp +++ b/src/modules/m_spanningtree/uid.cpp @@ -93,7 +93,7 @@ CmdResult CommandUID::HandleServer(TreeServer* remoteserver, CommandBase::Params if (*v == '+') continue; - /* For each mode thats set, find the mode handler and set it on the new user */ + /* For each mode that's set, find the mode handler and set it on the new user */ ModeHandler* mh = ServerInstance->Modes.FindMode(*v, MODETYPE_USER); if (!mh) throw ProtocolException("Unrecognised mode '" + std::string(1, *v) + "'"); diff --git a/src/modules/m_sqloper.cpp b/src/modules/m_sqloper.cpp index 8ad185ea9..d33227b22 100644 --- a/src/modules/m_sqloper.cpp +++ b/src/modules/m_sqloper.cpp @@ -4,7 +4,7 @@ * Copyright (C) 2019 B00mX0r <b00mx0r@aureus.pw> * Copyright (C) 2018 Dylan Frank <b00mx0r@aureus.pw> * Copyright (C) 2013-2014, 2018 Attila Molnar <attilamolnar@hush.com> - * Copyright (C) 2013, 2017-2018 Sadie Powell <sadie@witchery.services> + * Copyright (C) 2013, 2017-2018, 2020 Sadie Powell <sadie@witchery.services> * Copyright (C) 2012, 2019 Robby <robby@chatbelgie.be> * Copyright (C) 2009-2010 Daniel De Graaf <danieldg@inspircd.org> * Copyright (C) 2009 Uli Schlachter <psychon@inspircd.org> diff --git a/src/modules/m_sslinfo.cpp b/src/modules/m_sslinfo.cpp index 8f1b01839..3c259dcee 100644 --- a/src/modules/m_sslinfo.cpp +++ b/src/modules/m_sslinfo.cpp @@ -1,9 +1,9 @@ /* * InspIRCd -- Internet Relay Chat Daemon * + * Copyright (C) 2020 Matt Schatz <genius3000@g3k.solutions> * Copyright (C) 2019 linuxdaemon <linuxdaemon.irc@gmail.com> - * Copyright (C) 2013, 2017-2019 Sadie Powell <sadie@witchery.services> - * Copyright (C) 2013 Christopher 'm4z' Holm <them4z@gmail.com> + * Copyright (C) 2013, 2017-2020 Sadie Powell <sadie@witchery.services> * Copyright (C) 2012-2016 Attila Molnar <attilamolnar@hush.com> * Copyright (C) 2012 Robby <robby@chatbelgie.be> * Copyright (C) 2010 Adam <Adam@anope.org> @@ -176,11 +176,12 @@ class CommandSSLInfo : public Command ssl_cert* cert = sslapi.GetCertificate(target); if (!cert) { - user->WriteNotice("*** No TLS (SSL) client certificate for this user"); + user->WriteNotice(InspIRCd::Format("*** %s is not connected using TLS (SSL).", target->nick.c_str())); } else if (cert->GetError().length()) { - user->WriteNotice("*** No TLS (SSL) client certificate information for this user (" + cert->GetError() + ")."); + user->WriteNotice(InspIRCd::Format("*** %s is connected using TLS (SSL) but has not specified a valid client certificate (%s).", + target->nick.c_str(), cert->GetError().c_str())); } else { diff --git a/src/modules/m_sslmodes.cpp b/src/modules/m_sslmodes.cpp index 2e0c5a4eb..4180158ed 100644 --- a/src/modules/m_sslmodes.cpp +++ b/src/modules/m_sslmodes.cpp @@ -1,10 +1,11 @@ /* * InspIRCd -- Internet Relay Chat Daemon * - * Copyright (C) 2013, 2017-2019 Sadie Powell <sadie@witchery.services> + * Copyright (C) 2020 Matt Schatz <genius3000@g3k.solutions> + * Copyright (C) 2013, 2017-2020 Sadie Powell <sadie@witchery.services> * Copyright (C) 2013 Shawn Smith <ShawnSmith0828@gmail.com> * Copyright (C) 2012-2014 Attila Molnar <attilamolnar@hush.com> - * Copyright (C) 2012, 2019 Robby <robby@chatbelgie.be> + * Copyright (C) 2012 Robby <robby@chatbelgie.be> * Copyright (C) 2009-2010 Daniel De Graaf <danieldg@inspircd.org> * Copyright (C) 2009 Uli Schlachter <psychon@inspircd.org> * Copyright (C) 2008 Robin Burchell <robin+git@viroteck.net> @@ -190,7 +191,7 @@ class ModuleSSLModes User* target = msgtarget.Get<User>(); - /* If one or more of the parties involved is a ulined service, we wont stop it. */ + /* If one or more of the parties involved is a ulined service, we won't stop it. */ if (user->server->IsULine() || target->server->IsULine()) return MOD_RES_PASSTHRU; diff --git a/src/modules/m_starttls.cpp b/src/modules/m_starttls.cpp index 293e072fe..fd3158783 100644 --- a/src/modules/m_starttls.cpp +++ b/src/modules/m_starttls.cpp @@ -1,6 +1,7 @@ /* * InspIRCd -- Internet Relay Chat Daemon * + * Copyright (C) 2020 Matt Schatz <genius3000@g3k.solutions> * Copyright (C) 2019 Robby <robby@chatbelgie.be> * Copyright (C) 2018 Sadie Powell <sadie@witchery.services> * Copyright (C) 2014 Adam <Adam@anope.org> diff --git a/src/modules/m_svshold.cpp b/src/modules/m_svshold.cpp index 003c39828..a34b803e8 100644 --- a/src/modules/m_svshold.cpp +++ b/src/modules/m_svshold.cpp @@ -3,7 +3,7 @@ * * Copyright (C) 2019 Matt Schatz <genius3000@g3k.solutions> * Copyright (C) 2018 linuxdaemon <linuxdaemon.irc@gmail.com> - * Copyright (C) 2013, 2017-2018 Sadie Powell <sadie@witchery.services> + * Copyright (C) 2013, 2017-2018, 2020 Sadie Powell <sadie@witchery.services> * Copyright (C) 2012, 2018-2019 Robby <robby@chatbelgie.be> * Copyright (C) 2012, 2014, 2016 Attila Molnar <attilamolnar@hush.com> * Copyright (C) 2009 Daniel De Graaf <danieldg@inspircd.org> diff --git a/src/modules/m_swhois.cpp b/src/modules/m_swhois.cpp index de3d5bb1a..d840dba1e 100644 --- a/src/modules/m_swhois.cpp +++ b/src/modules/m_swhois.cpp @@ -2,7 +2,7 @@ * InspIRCd -- Internet Relay Chat Daemon * * Copyright (C) 2012-2016 Attila Molnar <attilamolnar@hush.com> - * Copyright (C) 2012-2013, 2017-2018 Sadie Powell <sadie@witchery.services> + * Copyright (C) 2012-2013, 2017-2018, 2020 Sadie Powell <sadie@witchery.services> * Copyright (C) 2012 Robby <robby@chatbelgie.be> * Copyright (C) 2009 Daniel De Graaf <danieldg@inspircd.org> * Copyright (C) 2007-2008 Robin Burchell <robin+git@viroteck.net> diff --git a/src/modules/m_userip.cpp b/src/modules/m_userip.cpp index 9e82000e7..ba6a8c5df 100644 --- a/src/modules/m_userip.cpp +++ b/src/modules/m_userip.cpp @@ -54,7 +54,7 @@ class CommandUserip : public Command { if (!checked_privs) { - // Do not trigger the insufficient priviliges message more than once + // Do not trigger the insufficient privileges message more than once checked_privs = true; has_privs = user->HasPrivPermission("users/auspex"); if (!has_privs) diff --git a/src/modules/m_vhost.cpp b/src/modules/m_vhost.cpp index 47a6b0595..bda8a9a3c 100644 --- a/src/modules/m_vhost.cpp +++ b/src/modules/m_vhost.cpp @@ -2,7 +2,7 @@ * InspIRCd -- Internet Relay Chat Daemon * * Copyright (C) 2018 linuxdaemon <linuxdaemon.irc@gmail.com> - * Copyright (C) 2013, 2018 Sadie Powell <sadie@witchery.services> + * Copyright (C) 2013, 2018, 2020 Sadie Powell <sadie@witchery.services> * Copyright (C) 2012, 2019 Robby <robby@chatbelgie.be> * Copyright (C) 2012 Attila Molnar <attilamolnar@hush.com> * Copyright (C) 2009 Daniel De Graaf <danieldg@inspircd.org> diff --git a/src/modules/m_xline_db.cpp b/src/modules/m_xline_db.cpp index 69696e078..eb222a371 100644 --- a/src/modules/m_xline_db.cpp +++ b/src/modules/m_xline_db.cpp @@ -3,7 +3,7 @@ * * Copyright (C) 2019 Matt Schatz <genius3000@g3k.solutions> * Copyright (C) 2014 Justin Crawford <Justasic@Gmail.com> - * Copyright (C) 2013, 2015, 2018-2019 Sadie Powell <sadie@witchery.services> + * Copyright (C) 2013, 2015, 2018-2020 Sadie Powell <sadie@witchery.services> * Copyright (C) 2012-2013 Attila Molnar <attilamolnar@hush.com> * Copyright (C) 2012, 2019 Robby <robby@chatbelgie.be> * Copyright (C) 2012, 2014 Adam <Adam@anope.org> @@ -157,7 +157,7 @@ class ModuleXLineDB #ifdef _WIN32 remove(xlinedbpath.c_str()); #endif - // Use rename to move temporary to new db - this is guarenteed not to fuck up, even in case of a crash. + // Use rename to move temporary to new db - this is guaranteed not to fuck up, even in case of a crash. if (rename(xlinenewdbpath.c_str(), xlinedbpath.c_str()) < 0) { ServerInstance->Logs.Log(MODNAME, LOG_DEBUG, "Cannot replace old database \"%s\" with new database \"%s\"! %s (%d)", xlinedbpath.c_str(), xlinenewdbpath.c_str(), strerror(errno), errno); |
