mirror of
https://github.com/anope/anope.git
synced 2026-06-16 20:54:46 +02:00
Compare commits
32 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 756dc49813 | |||
| aa92559aa0 | |||
| eb12a89b8e | |||
| d4a34308e5 | |||
| aab3a8e5b6 | |||
| c72e12d0a6 | |||
| bce0d629fd | |||
| 7d0dacc86c | |||
| 729aa4ab4a | |||
| 18e9e12261 | |||
| 9d68b29c9e | |||
| a4792412ba | |||
| 8bb83f6b1a | |||
| da99a53dfa | |||
| a9e9ac32a0 | |||
| 05e6df23a2 | |||
| 3f9fc23270 | |||
| cb21c7c1fa | |||
| 4008e64f26 | |||
| 1cf5918574 | |||
| afe87bf693 | |||
| ff1c5adb8b | |||
| c36030c826 | |||
| 33a02b1223 | |||
| 68f4556609 | |||
| 23db58a303 | |||
| ee69dc3105 | |||
| e9243c3fde | |||
| 4cfee23303 | |||
| be3822523b | |||
| 111f81aa95 | |||
| f12e1ad222 |
@@ -15,7 +15,7 @@ jobs:
|
||||
- uses: actions/checkout@v4
|
||||
|
||||
- name: Setup MSBuild
|
||||
uses: microsoft/setup-msbuild@v1.3
|
||||
uses: microsoft/setup-msbuild@v2
|
||||
|
||||
- name: Setup Conan
|
||||
uses: turtlebrowser/get-conan@v1.2
|
||||
|
||||
+1
-1
@@ -355,7 +355,7 @@ get_filename_component(ABSOLUTE_LOG_DIR ${LOG_DIR} REALPATH BASE_DIR ${CMAKE_INS
|
||||
install(CODE "file(MAKE_DIRECTORY \"\$ENV{DESTDIR}${ABSOLUTE_DATA_DIR}/backups\")")
|
||||
install(CODE "file(MAKE_DIRECTORY \"\$ENV{DESTDIR}${ABSOLUTE_LOG_DIR}\")")
|
||||
if(WIN32)
|
||||
install(CODE "file(MAKE_DIRECTORY \"\$ENV{DESTDIR}\${ABSOLUTE_DATA_DIR}/runtime\")")
|
||||
install(CODE "file(MAKE_DIRECTORY \"\$ENV{DESTDIR}${ABSOLUTE_DATA_DIR}/runtime\")")
|
||||
endif()
|
||||
# On non-Windows platforms, if RUNGROUP is set, change the permissions of the below directories, as well as the group of the data directory
|
||||
if(NOT WIN32 AND RUNGROUP)
|
||||
|
||||
+1
-25
@@ -265,26 +265,7 @@ serverinfo
|
||||
* - solanum
|
||||
* - unrealircd
|
||||
*/
|
||||
module
|
||||
{
|
||||
name = "inspircd"
|
||||
|
||||
/*
|
||||
* Some protocol modules can enforce mode locks server-side. This reduces the spam caused by
|
||||
* services immediately reversing mode changes for locked modes.
|
||||
*
|
||||
* If the protocol module you have loaded does not support this, this setting will have no effect.
|
||||
*/
|
||||
use_server_side_mlock = yes
|
||||
|
||||
/*
|
||||
* Some protocol modules can enforce topic locks server-side. This reduces the spam caused by
|
||||
* services immediately reversing topic changes.
|
||||
*
|
||||
* If the protocol module you have loaded does not support this, this setting will have no effect.
|
||||
*/
|
||||
use_server_side_topiclock = yes
|
||||
}
|
||||
module { name = "inspircd" }
|
||||
|
||||
/*
|
||||
* [REQUIRED] Network Information
|
||||
@@ -1153,11 +1134,6 @@ module
|
||||
* This is only useful with very large databases, with hundreds
|
||||
* of thousands of objects, that have a noticeable delay from
|
||||
* writing databases.
|
||||
*
|
||||
* If your database is large enough cause a noticeable delay when
|
||||
* saving you should consider a more powerful alternative such
|
||||
* as db_sql or db_redis, which incrementally update their
|
||||
* databases asynchronously in real time.
|
||||
*/
|
||||
fork = no
|
||||
}
|
||||
|
||||
@@ -286,6 +286,12 @@ module
|
||||
{
|
||||
name = "ns_cert"
|
||||
|
||||
/*
|
||||
* Should users who are connected with a SSL client certificate have its fingerprint be added to
|
||||
* their account when they register. Defaults to yes.
|
||||
*/
|
||||
automatic = yes
|
||||
|
||||
/*
|
||||
* The maximum number of entries allowed on a nickname's certificate fingerprint list.
|
||||
* The default is 5. This number cannot be set to 0.
|
||||
|
||||
@@ -1,3 +1,20 @@
|
||||
Anope Version 2.1.6
|
||||
-------------------
|
||||
Added opportunistic upgrading of TLS fingerprints to more secure algorithms on InspIRCd.
|
||||
Added support for logging out partially connected users on Plexus.
|
||||
Added the account registration time to nickserv/info.
|
||||
Changed ns_cert to automatically add a TLS fingerprint to new accounts if available.
|
||||
Clarified that a non-deprecated encryption module must be loaded.
|
||||
Fixed creating the runtime directory on Windows.
|
||||
Fixed mistakenly allowing badpasslimit to be set to a negative value.
|
||||
Fixed parsing backup TLS fingerprints on InspIRCd.
|
||||
Fixed parsing the flood mode on UnrealIRCd.
|
||||
Fixed parsing the history mode on UnrealIRCd.
|
||||
Fixed various iterator invalidation issues.
|
||||
Partially rewrote the Portuguese translation.
|
||||
Removed some incorrect strings from the Turkish translation.
|
||||
Renamed the --modulesdir option to --moduledir to match the name of other path options.
|
||||
|
||||
Anope Version 2.1.5
|
||||
-------------------
|
||||
Added an example systemd unit file.
|
||||
|
||||
@@ -1,3 +1,9 @@
|
||||
Anope Version 2.1.6
|
||||
-------------------
|
||||
Added module:automatic to the ns_cert module (defaults to yes).
|
||||
Removed module:use_server_side_mlock for the protocol modules (now always enabled).
|
||||
Removed module:use_server_side_topiclock for the protocol modules (now always enabled).
|
||||
|
||||
Anope Version 2.1.5
|
||||
-------------------
|
||||
Added the nickserv/drop/override and chanserv/drop/override oper privileges.
|
||||
|
||||
@@ -130,6 +130,8 @@ public:
|
||||
Anope::string language;
|
||||
/* Last time an email was sent to this user */
|
||||
time_t lastmail = 0;
|
||||
/* The time this account was registered */
|
||||
time_t time_registered = Anope::CurTime;
|
||||
MemoInfo memos;
|
||||
std::map<Anope::string, Anope::string> last_modes;
|
||||
|
||||
|
||||
@@ -717,9 +717,6 @@ protected:
|
||||
*/
|
||||
Anope::string source;
|
||||
public:
|
||||
/** Default constructor, just uses the error message 'Core threw an exception'.
|
||||
*/
|
||||
CoreException() : err("Core threw an exception"), source("The core") { }
|
||||
/** This constructor can be used to specify an error message before throwing.
|
||||
*/
|
||||
CoreException(const Anope::string &message) : err(message), source("The core") { }
|
||||
@@ -750,10 +747,6 @@ class CoreExport ModuleException
|
||||
: public CoreException
|
||||
{
|
||||
public:
|
||||
/** Default constructor, just uses the error message 'Module threw an exception'.
|
||||
*/
|
||||
ModuleException() : CoreException("Module threw an exception", "A Module") { }
|
||||
|
||||
/** This constructor can be used to specify an error message before throwing.
|
||||
*/
|
||||
ModuleException(const Anope::string &message) : CoreException(message, "A Module") { }
|
||||
|
||||
@@ -194,6 +194,7 @@ public:
|
||||
|
||||
void ExtensibleSerialize(const Extensible *e, const Serializable *s, Serialize::Data &data) const override
|
||||
{
|
||||
data.SetType(this->name, Serialize::Data::DT_INT);
|
||||
data[this->name] << true;
|
||||
}
|
||||
|
||||
|
||||
@@ -199,6 +199,8 @@ public:
|
||||
class CoreExport NotImplementedException final
|
||||
: public CoreException
|
||||
{
|
||||
public:
|
||||
NotImplementedException() : CoreException("") { }
|
||||
};
|
||||
|
||||
/** Every module in Anope is actually a class.
|
||||
|
||||
@@ -79,4 +79,5 @@ public:
|
||||
CertService(Module *c) : Service(c, "CertService", "certs") { }
|
||||
|
||||
virtual NickCore *FindAccountFromCert(const Anope::string &cert) = 0;
|
||||
virtual void ReplaceCert(const Anope::string &oldcert, const Anope::string &newcert) = 0;
|
||||
};
|
||||
|
||||
@@ -101,9 +101,6 @@ public:
|
||||
/* See ns_cert */
|
||||
bool CanCertFP = false;
|
||||
|
||||
/* Can users log out before being fully connected? */
|
||||
bool CanSVSLogout = false;
|
||||
|
||||
/* Whether this IRCd requires unique IDs for each user or server. See TS6/P10. */
|
||||
bool RequiresID = false;
|
||||
|
||||
|
||||
@@ -7,8 +7,8 @@ msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: Anope\n"
|
||||
"Report-Msgid-Bugs-To: \n"
|
||||
"POT-Creation-Date: 2024-04-07 15:51+0100\n"
|
||||
"PO-Revision-Date: 2024-04-07 15:51+0100\n"
|
||||
"POT-Creation-Date: 2024-05-11 17:38+0100\n"
|
||||
"PO-Revision-Date: 2024-05-11 17:39+0100\n"
|
||||
"Last-Translator: Sadie Powell <sadie@witchery.services>\n"
|
||||
"Language-Team: English\n"
|
||||
"Language: en_US\n"
|
||||
@@ -16,7 +16,7 @@ msgstr ""
|
||||
"Content-Type: text/plain; charset=ISO-8859-1\n"
|
||||
"Content-Transfer-Encoding: 8bit\n"
|
||||
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
|
||||
"X-Generator: Poedit 3.4\n"
|
||||
"X-Generator: Poedit 3.4.2\n"
|
||||
|
||||
#, c-format
|
||||
msgid "%d channel(s) cleared, and %d channel(s) dropped."
|
||||
@@ -1812,6 +1812,9 @@ msgstr "Account"
|
||||
msgid "Account %s has already reached the maximum number of simultaneous logins (%u)."
|
||||
msgstr "Account %s has already reached the maximum number of simultaneous logins (%u)."
|
||||
|
||||
msgid "Account registered"
|
||||
msgstr "Account registered"
|
||||
|
||||
msgid "Accounts can not be registered right now. Please try again later."
|
||||
msgstr "Accounts can not be registered right now. Please try again later."
|
||||
|
||||
@@ -5141,6 +5144,9 @@ msgstr "Nick %s is now released."
|
||||
msgid "Nick %s is now suspended."
|
||||
msgstr "Nick %s is now suspended."
|
||||
|
||||
msgid "Nick registered"
|
||||
msgstr "Nick registered"
|
||||
|
||||
#, c-format
|
||||
msgid "Nick too long, max length is %zu characters."
|
||||
msgstr "Nick too long, max length is %zu characters."
|
||||
|
||||
+2350
-4599
File diff suppressed because it is too large
Load Diff
+10
-27
@@ -8,7 +8,7 @@ msgstr ""
|
||||
"Project-Id-Version: Anope\n"
|
||||
"Report-Msgid-Bugs-To: \n"
|
||||
"POT-Creation-Date: 2024-04-15 15:31+0100\n"
|
||||
"PO-Revision-Date: 2024-04-15 15:32+0100\n"
|
||||
"PO-Revision-Date: 2024-05-11 18:28+0100\n"
|
||||
"Last-Translator: CaPaCuL <capacul@gmail.com>\n"
|
||||
"Language-Team: Turkish\n"
|
||||
"Language: tr_TR\n"
|
||||
@@ -16,7 +16,7 @@ msgstr ""
|
||||
"Content-Type: text/plain; charset=UTF-8\n"
|
||||
"Content-Transfer-Encoding: 8bit\n"
|
||||
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
|
||||
"X-Generator: Poedit 3.4\n"
|
||||
"X-Generator: Poedit 3.4.2\n"
|
||||
|
||||
#, c-format
|
||||
msgid "%d channel(s) cleared, and %d channel(s) dropped."
|
||||
@@ -2282,13 +2282,6 @@ msgid ""
|
||||
"message number can be obtained from the output of the QUEUE LIST command.\n"
|
||||
"The QUEUE LIST command lists all messages that are currently in the message queue."
|
||||
msgstr ""
|
||||
"Allows queueing messages to send to users on the network.\n"
|
||||
"\n"
|
||||
"The QUEUE ADD command adds the given message to the message queue.\n"
|
||||
"The QUEUE CLEAR command clears the message queue.\n"
|
||||
"The QUEUE DEL command removes the specified message from the message queue. The\n"
|
||||
"message number can be obtained from the output of the QUEUE LIST command.\n"
|
||||
"The QUEUE LIST command lists all messages that are currently in the message queue."
|
||||
|
||||
#, c-format
|
||||
msgid ""
|
||||
@@ -2298,11 +2291,6 @@ msgid ""
|
||||
"You can either send a message by specifying it as a parameter or provide no\n"
|
||||
"parameters to send a previously queued message.\n"
|
||||
msgstr ""
|
||||
"Allows sending messages to all users on a server. The message will be sent\n"
|
||||
"from %s.\n"
|
||||
"\n"
|
||||
"You can either send a message by specifying it as a parameter or provide no\n"
|
||||
"parameters to send a previously queued message.\n"
|
||||
|
||||
#, c-format
|
||||
msgid ""
|
||||
@@ -2312,11 +2300,6 @@ msgid ""
|
||||
"You can either send a message by specifying it as a parameter or provide no\n"
|
||||
"parameters to send a previously queued message.\n"
|
||||
msgstr ""
|
||||
"Allows sending messages to all users on the network. The message will be sent\n"
|
||||
"from %s.\n"
|
||||
"\n"
|
||||
"You can either send a message by specifying it as a parameter or provide no\n"
|
||||
"parameters to send a previously queued message.\n"
|
||||
|
||||
#, c-format
|
||||
msgid ""
|
||||
@@ -4345,7 +4328,7 @@ msgid "Level must be between %d and %d inclusive."
|
||||
msgstr "Seviye %d ile %d dahil arasında olmalıdır."
|
||||
|
||||
msgid "Limit"
|
||||
msgstr "Limit"
|
||||
msgstr ""
|
||||
|
||||
msgid "List all registered nicknames that match a given pattern"
|
||||
msgstr "Belirtilen şablonla eşleşen tüm rumuzları listeler"
|
||||
@@ -4856,7 +4839,7 @@ msgid "Manage your auto join list"
|
||||
msgstr "Oto-gir listenizi yönetin"
|
||||
|
||||
msgid "Manages your pending message queue."
|
||||
msgstr "Manages your pending message queue."
|
||||
msgstr ""
|
||||
|
||||
#, c-format
|
||||
msgid "Manipulate the %s list"
|
||||
@@ -4941,7 +4924,7 @@ msgstr "%c modu için eksik parametre."
|
||||
|
||||
#, c-format
|
||||
msgid "Missing passwords: %zu"
|
||||
msgstr "Missing passwords: %zu"
|
||||
msgstr ""
|
||||
|
||||
msgid "Mode"
|
||||
msgstr "Mod"
|
||||
@@ -5379,7 +5362,7 @@ msgstr "Şifreler şu anda değiştirilemez. Lütfen daha sonra tekrar deneyiniz
|
||||
|
||||
#, c-format
|
||||
msgid "Passwords encrypted with %s: %zu"
|
||||
msgstr "Passwords encrypted with %s: %zu"
|
||||
msgstr ""
|
||||
|
||||
msgid "Peace"
|
||||
msgstr "Barış"
|
||||
@@ -5397,7 +5380,7 @@ msgstr "Kalıcı"
|
||||
|
||||
#, c-format
|
||||
msgid "Please confirm that you want to drop %s with %s%s DROP %s %s"
|
||||
msgstr "Please confirm that you want to drop %s with %s%s DROP %s %s"
|
||||
msgstr ""
|
||||
|
||||
msgid "Please contact an Operator to get a vhost assigned to this nick."
|
||||
msgstr "Bu rumuza atanan bir vHost almak için lütfen bir operle iletişime geçin."
|
||||
@@ -7939,7 +7922,7 @@ msgstr ""
|
||||
|
||||
#, c-format
|
||||
msgid "Type %s%s SET EMAIL email in order to set your email."
|
||||
msgstr "Type %s%s SET EMAIL email in order to set your email."
|
||||
msgstr ""
|
||||
|
||||
msgid "Un-Load a module"
|
||||
msgstr "Bir modülün yüklemesini kaldır"
|
||||
@@ -8324,7 +8307,7 @@ msgid "You can not request a receipt when sending a memo to yourself."
|
||||
msgstr "Kendinize memo gönderirken makbuz talep edemezsiniz."
|
||||
|
||||
msgid "You can not send a single message while you have messages queued."
|
||||
msgstr "You can not send a single message while you have messages queued."
|
||||
msgstr ""
|
||||
|
||||
#, c-format
|
||||
msgid "You can't %s yourself!"
|
||||
@@ -8392,7 +8375,7 @@ msgid "You do not have access to set mode %c."
|
||||
msgstr "%c modunu ayarlama erişiminiz yok."
|
||||
|
||||
msgid "You do not have any messages queued and did not specify a message to send."
|
||||
msgstr "You do not have any messages queued and did not specify a message to send."
|
||||
msgstr ""
|
||||
|
||||
msgid "You do not have any queued messages."
|
||||
msgstr "Sıraya alınmış mesajınız yok."
|
||||
|
||||
+10
-11
@@ -53,17 +53,16 @@ struct KickerDataImpl final
|
||||
if (kd == NULL)
|
||||
return;
|
||||
|
||||
data["kickerdata:amsgs"] << kd->amsgs;
|
||||
data["kickerdata:badwords"] << kd->badwords;
|
||||
data["kickerdata:bolds"] << kd->bolds;
|
||||
data["kickerdata:caps"] << kd->caps;
|
||||
data["kickerdata:colors"] << kd->colors;
|
||||
data["kickerdata:flood"] << kd->flood;
|
||||
data["kickerdata:italics"] << kd->italics;
|
||||
data["kickerdata:repeat"] << kd->repeat;
|
||||
data["kickerdata:reverses"] << kd->reverses;
|
||||
data["kickerdata:underlines"] << kd->underlines;
|
||||
|
||||
data.SetType("kickerdata:amsgs", Serialize::Data::DT_INT); data["kickerdata:amsgs"] << kd->amsgs;
|
||||
data.SetType("kickerdata:badwords", Serialize::Data::DT_INT); data["kickerdata:badwords"] << kd->badwords;
|
||||
data.SetType("kickerdata:bolds", Serialize::Data::DT_INT); data["kickerdata:bolds"] << kd->bolds;
|
||||
data.SetType("kickerdata:caps", Serialize::Data::DT_INT); data["kickerdata:caps"] << kd->caps;
|
||||
data.SetType("kickerdata:colors", Serialize::Data::DT_INT); data["kickerdata:colors"] << kd->colors;
|
||||
data.SetType("kickerdata:flood", Serialize::Data::DT_INT); data["kickerdata:flood"] << kd->flood;
|
||||
data.SetType("kickerdata:italics", Serialize::Data::DT_INT); data["kickerdata:italics"] << kd->italics;
|
||||
data.SetType("kickerdata:repeat", Serialize::Data::DT_INT); data["kickerdata:repeat"] << kd->repeat;
|
||||
data.SetType("kickerdata:reverses", Serialize::Data::DT_INT); data["kickerdata:reverses"] << kd->reverses;
|
||||
data.SetType("kickerdata:underlines", Serialize::Data::DT_INT); data["kickerdata:underlines"] << kd->underlines;
|
||||
data.SetType("capsmin", Serialize::Data::DT_INT); data["capsmin"] << kd->capsmin;
|
||||
data.SetType("capspercent", Serialize::Data::DT_INT); data["capspercent"] << kd->capspercent;
|
||||
data.SetType("floodlines", Serialize::Data::DT_INT); data["floodlines"] << kd->floodlines;
|
||||
|
||||
@@ -658,7 +658,8 @@ class CommandCSMode final
|
||||
}
|
||||
else
|
||||
{
|
||||
for (const auto &mode : ci->c->GetModeList(cm->name))
|
||||
std::vector<Anope::string> v = ci->c->GetModeList(cm->name);
|
||||
for (const auto &mode : v)
|
||||
{
|
||||
if (Anope::Match(mode, param))
|
||||
ci->c->RemoveMode(NULL, cm, mode);
|
||||
|
||||
@@ -1146,7 +1146,7 @@ public:
|
||||
if (c->ci && keep_modes.HasExt(c->ci))
|
||||
{
|
||||
Channel::ModeList ml = c->ci->last_modes;
|
||||
for (const auto &[last_mode, last_value] : c->ci->last_modes)
|
||||
for (const auto &[last_mode, last_value] : ml)
|
||||
c->SetMode(c->ci->WhoSends(), last_mode, last_value);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1131,7 +1131,7 @@ private:
|
||||
auto display = row.Get();
|
||||
auto pass = row.Get();
|
||||
auto email = row.Get();
|
||||
/* auto regtime = */ row.GetNum<time_t>();
|
||||
auto regtime = row.GetNum<time_t>();
|
||||
/* auto lastlogin = */ row.Get();
|
||||
auto flags = row.Get();
|
||||
auto language = row.Get();
|
||||
@@ -1141,6 +1141,7 @@ private:
|
||||
|
||||
auto *nc = new NickCore(display);
|
||||
nc->email = email;
|
||||
nc->time_registered = regtime;
|
||||
ApplyPassword(nc, flags, pass);
|
||||
|
||||
// No equivalent: bglmNQrS
|
||||
|
||||
+10
-5
@@ -354,9 +354,14 @@ Result MySQLService::RunQuery(const Query &query)
|
||||
{
|
||||
this->Lock.lock();
|
||||
|
||||
Anope::string real_query = this->BuildQuery(query);
|
||||
if (!this->CheckConnection())
|
||||
{
|
||||
this->Lock.unlock();
|
||||
return MySQLResult(query, query.query, mysql_error(this->sql));
|
||||
}
|
||||
|
||||
if (this->CheckConnection() && !mysql_real_query(this->sql, real_query.c_str(), real_query.length()))
|
||||
Anope::string real_query = this->BuildQuery(query);
|
||||
if (!mysql_real_query(this->sql, real_query.c_str(), real_query.length()))
|
||||
{
|
||||
MYSQL_RES *res = mysql_store_result(this->sql);
|
||||
unsigned int id = mysql_insert_id(this->sql);
|
||||
@@ -410,11 +415,11 @@ std::vector<Query> MySQLService::CreateTable(const Anope::string &table, const D
|
||||
|
||||
query_text += ", `" + column + "` ";
|
||||
if (data.GetType(column) == Serialize::Data::DT_INT)
|
||||
query_text += "int(11)";
|
||||
query_text += "int";
|
||||
else
|
||||
query_text += "text";
|
||||
}
|
||||
query_text += ", PRIMARY KEY (`id`), KEY `timestamp_idx` (`timestamp`))";
|
||||
query_text += ", PRIMARY KEY (`id`), KEY `timestamp_idx` (`timestamp`)) ROW_FORMAT=DYNAMIC";
|
||||
queries.push_back(query_text);
|
||||
}
|
||||
else
|
||||
@@ -428,7 +433,7 @@ std::vector<Query> MySQLService::CreateTable(const Anope::string &table, const D
|
||||
|
||||
Anope::string query_text = "ALTER TABLE `" + table + "` ADD `" + column + "` ";
|
||||
if (data.GetType(column) == Serialize::Data::DT_INT)
|
||||
query_text += "int(11)";
|
||||
query_text += "int";
|
||||
else
|
||||
query_text += "text";
|
||||
|
||||
|
||||
@@ -26,6 +26,17 @@ struct CertServiceImpl final
|
||||
return it->second;
|
||||
return NULL;
|
||||
}
|
||||
|
||||
void ReplaceCert(const Anope::string &oldcert, const Anope::string &newcert) override
|
||||
{
|
||||
auto *nc = FindAccountFromCert(oldcert);
|
||||
if (!nc)
|
||||
return;
|
||||
|
||||
auto *cl = nc->GetExt<NSCertList>("certificates");
|
||||
if (cl)
|
||||
cl->ReplaceCert(oldcert, newcert);
|
||||
}
|
||||
};
|
||||
|
||||
struct NSCertListImpl final
|
||||
@@ -405,6 +416,15 @@ public:
|
||||
Log(NickServ) << u->GetMask() << " automatically identified for account " << nc->display << " via SSL certificate fingerprint";
|
||||
}
|
||||
|
||||
void OnNickRegister(User *u, NickAlias *na, const Anope::string &pass) override
|
||||
{
|
||||
if (!Config->GetModule(this)->Get<bool>("automatic", "yes") || u->fingerprint.empty())
|
||||
return;
|
||||
|
||||
auto *cl = certs.Require(na->nc);
|
||||
cl->AddCert(u->fingerprint);
|
||||
}
|
||||
|
||||
EventReturn OnNickValidate(User *u, NickAlias *na) override
|
||||
{
|
||||
NSCertList *cl = certs.Get(na->nc);
|
||||
|
||||
@@ -88,7 +88,8 @@ public:
|
||||
info[_("Last seen address")] = na->last_realhost;
|
||||
}
|
||||
|
||||
info[_("Registered")] = Anope::strftime(na->time_registered, source.GetAccount());
|
||||
info[_("Account registered")] = Anope::strftime(na->nc->time_registered, source.GetAccount());
|
||||
info[_("Nick registered")] = Anope::strftime(na->time_registered, source.GetAccount());
|
||||
|
||||
if (!nick_online)
|
||||
info[_("Last seen")] = Anope::strftime(na->last_seen, source.GetAccount());
|
||||
|
||||
@@ -1354,7 +1354,8 @@ public:
|
||||
{
|
||||
if (keep_modes.HasExt(u->Account()))
|
||||
{
|
||||
for (const auto &[last_mode, last_value] : u->Account()->last_modes)
|
||||
User::ModeList modes = u->Account()->last_modes;
|
||||
for (const auto &[last_mode, last_value] : modes)
|
||||
{
|
||||
UserMode *um = ModeManager::FindUserModeByName(last_mode);
|
||||
/* if the null user can set the mode, then it's probably safe */
|
||||
|
||||
@@ -711,8 +711,6 @@ class ProtoHybrid final
|
||||
IRCDMessageTMode message_tmode;
|
||||
IRCDMessageUID message_uid;
|
||||
|
||||
bool use_server_side_mlock;
|
||||
|
||||
static void AddModes()
|
||||
{
|
||||
/* Add user modes */
|
||||
@@ -819,18 +817,13 @@ public:
|
||||
u->RemoveModeInternal(Me, ModeManager::FindUserModeByName("REGISTERED"));
|
||||
}
|
||||
|
||||
void OnReload(Configuration::Conf *conf) override
|
||||
{
|
||||
use_server_side_mlock = conf->GetModule(this)->Get<bool>("use_server_side_mlock");
|
||||
}
|
||||
|
||||
void OnChannelSync(Channel *c) override
|
||||
{
|
||||
if (!c->ci)
|
||||
return;
|
||||
|
||||
ModeLocks *modelocks = c->ci->GetExt<ModeLocks>("modelocks");
|
||||
if (use_server_side_mlock && modelocks && Servers::Capab.count("MLOCK"))
|
||||
if (modelocks && Servers::Capab.count("MLOCK"))
|
||||
{
|
||||
Anope::string modes = modelocks->GetMLockAsString(false).replace_all_cs("+", "").replace_all_cs("-", "");
|
||||
Uplink::Send("MLOCK", c->creation_time, c->ci->name, Anope::CurTime, modes);
|
||||
@@ -839,7 +832,7 @@ public:
|
||||
|
||||
void OnDelChan(ChannelInfo *ci) override
|
||||
{
|
||||
if (use_server_side_mlock && ci->c && Servers::Capab.count("MLOCK"))
|
||||
if (ci->c && Servers::Capab.count("MLOCK"))
|
||||
Uplink::Send("MLOCK", ci->c->creation_time, ci->name, Anope::CurTime, "");
|
||||
}
|
||||
|
||||
@@ -847,7 +840,7 @@ public:
|
||||
{
|
||||
ModeLocks *modelocks = ci->GetExt<ModeLocks>("modelocks");
|
||||
ChannelMode *cm = ModeManager::FindChannelModeByName(lock->name);
|
||||
if (use_server_side_mlock && cm && ci->c && modelocks && (cm->type == MODE_REGULAR || cm->type == MODE_PARAM) && Servers::Capab.count("MLOCK"))
|
||||
if (cm && ci->c && modelocks && (cm->type == MODE_REGULAR || cm->type == MODE_PARAM) && Servers::Capab.count("MLOCK"))
|
||||
{
|
||||
Anope::string modes = modelocks->GetMLockAsString(false).replace_all_cs("+", "").replace_all_cs("-", "") + cm->mchar;
|
||||
Uplink::Send("MLOCK", ci->c->creation_time, ci->name, Anope::CurTime, modes);
|
||||
@@ -860,7 +853,7 @@ public:
|
||||
{
|
||||
ModeLocks *modelocks = ci->GetExt<ModeLocks>("modelocks");
|
||||
ChannelMode *cm = ModeManager::FindChannelModeByName(lock->name);
|
||||
if (use_server_side_mlock && cm && modelocks && ci->c && (cm->type == MODE_REGULAR || cm->type == MODE_PARAM) && Servers::Capab.count("MLOCK"))
|
||||
if (cm && modelocks && ci->c && (cm->type == MODE_REGULAR || cm->type == MODE_PARAM) && Servers::Capab.count("MLOCK"))
|
||||
{
|
||||
Anope::string modes = modelocks->GetMLockAsString(false).replace_all_cs("+", "").replace_all_cs("-", "").replace_all_cs(cm->mchar, "");
|
||||
Uplink::Send("MLOCK", ci->c->creation_time, ci->name, Anope::CurTime, modes);
|
||||
|
||||
@@ -10,9 +10,10 @@
|
||||
*/
|
||||
|
||||
#include "module.h"
|
||||
#include "modules/encryption.h"
|
||||
#include "modules/cs_mode.h"
|
||||
#include "modules/encryption.h"
|
||||
#include "modules/httpd.h"
|
||||
#include "modules/ns_cert.h"
|
||||
#include "modules/sasl.h"
|
||||
|
||||
typedef std::map<char, unsigned> ListLimits;
|
||||
@@ -144,7 +145,6 @@ public:
|
||||
CanSetVIdent = true;
|
||||
CanSQLine = true;
|
||||
CanSZLine = true;
|
||||
CanSVSLogout = true;
|
||||
CanCertFP = true;
|
||||
RequiresID = true;
|
||||
MaxModes = 0;
|
||||
@@ -1805,12 +1805,20 @@ struct IRCDMessageSave final
|
||||
class IRCDMessageMetadata final
|
||||
: IRCDMessage
|
||||
{
|
||||
const bool &do_topiclock;
|
||||
const bool &do_mlock;
|
||||
private:
|
||||
ServiceReference<CertService> certs;
|
||||
PrimitiveExtensibleItem<ListLimits> &maxlist;
|
||||
|
||||
|
||||
public:
|
||||
IRCDMessageMetadata(Module *creator, const bool &handle_topiclock, const bool &handle_mlock, PrimitiveExtensibleItem<ListLimits> &listlimits) : IRCDMessage(creator, "METADATA", 3), do_topiclock(handle_topiclock), do_mlock(handle_mlock), maxlist(listlimits) { SetFlag(FLAG_REQUIRE_SERVER); SetFlag(FLAG_SOFT_LIMIT); }
|
||||
IRCDMessageMetadata(Module *creator, PrimitiveExtensibleItem<ListLimits> &listlimits)
|
||||
: IRCDMessage(creator, "METADATA", 3)
|
||||
, certs("CertService", "certs")
|
||||
, maxlist(listlimits)
|
||||
{
|
||||
SetFlag(FLAG_REQUIRE_SERVER);
|
||||
SetFlag(FLAG_SOFT_LIMIT);
|
||||
}
|
||||
|
||||
void Run(MessageSource &source, const std::vector<Anope::string> ¶ms, const Anope::map<Anope::string> &tags) override
|
||||
{
|
||||
@@ -1822,7 +1830,7 @@ public:
|
||||
Channel *c = Channel::Find(params[0]);
|
||||
if (c)
|
||||
{
|
||||
if ((c->ci) && (do_mlock) && (params[2] == "mlock"))
|
||||
if (c->ci && params[2] == "mlock")
|
||||
{
|
||||
ModeLocks *modelocks = c->ci->GetExt<ModeLocks>("modelocks");
|
||||
Anope::string modes;
|
||||
@@ -1833,7 +1841,7 @@ public:
|
||||
if (modes != params[3])
|
||||
Uplink::Send("METADATA", c->name, c->creation_time, "mlock", modes);
|
||||
}
|
||||
else if ((c->ci) && (do_topiclock) && (params[2] == "topiclock"))
|
||||
else if (c->ci && params[2] == "topiclock")
|
||||
{
|
||||
bool mystate = c->ci->HasExt("TOPICLOCK");
|
||||
bool serverstate = (params[3] == "1");
|
||||
@@ -1855,12 +1863,12 @@ public:
|
||||
}
|
||||
else if (isdigit(params[0][0]))
|
||||
{
|
||||
auto *u = User::Find(params[0]);
|
||||
if (!u)
|
||||
return;
|
||||
|
||||
if (params[1].equals_cs("accountname"))
|
||||
{
|
||||
User *u = User::Find(params[0]);
|
||||
if (!u)
|
||||
return; // Should never happen.
|
||||
|
||||
if (params[2].empty())
|
||||
{
|
||||
// The user has been logged out by the IRC server.
|
||||
@@ -1883,18 +1891,22 @@ public:
|
||||
*/
|
||||
else if (params[1].equals_cs("ssl_cert"))
|
||||
{
|
||||
User *u = User::Find(params[0]);
|
||||
if (!u)
|
||||
return;
|
||||
u->Extend<bool>("ssl");
|
||||
Anope::string data = params[2].c_str();
|
||||
size_t pos1 = data.find(' ') + 1;
|
||||
size_t pos2 = data.find(' ', pos1);
|
||||
if ((pos2 - pos1) >= 32) // inspircd supports md5 and sha1 fingerprint hashes -> size 32 or 40 bytes.
|
||||
{
|
||||
u->fingerprint = data.substr(pos1, pos2 - pos1);
|
||||
}
|
||||
|
||||
Anope::string data;
|
||||
spacesepstream tokens(params[2]);
|
||||
if (!tokens.GetToken(data) || data.find('E') != Anope::string::npos || !tokens.GetToken(data))
|
||||
return; // Malformed or no client certificate.
|
||||
|
||||
commasepstream fingerprints(data);
|
||||
if (!fingerprints.GetToken(data))
|
||||
return; // Should never happen?
|
||||
|
||||
u->fingerprint = data;
|
||||
FOREACH_MOD(OnFingerprint, (u));
|
||||
|
||||
while (certs && fingerprints.GetToken(data))
|
||||
certs->ReplaceCert(data, u->fingerprint);
|
||||
}
|
||||
}
|
||||
else if (params[0] == "*")
|
||||
@@ -2437,8 +2449,6 @@ class ProtoInspIRCd final
|
||||
IRCDMessageSQuit message_squit;
|
||||
IRCDMessageUID message_uid;
|
||||
|
||||
bool use_server_side_topiclock, use_server_side_mlock;
|
||||
|
||||
static void SendChannelMetadata(Channel *c, const Anope::string &metadataname, const Anope::string &value)
|
||||
{
|
||||
Uplink::Send("METADATA", c->name, c->creation_time, metadataname, value);
|
||||
@@ -2475,7 +2485,7 @@ public:
|
||||
, message_ijoin(this)
|
||||
, message_kick(this)
|
||||
, message_lmode(this)
|
||||
, message_metadata(this, use_server_side_topiclock, use_server_side_mlock, ircd_proto.maxlist)
|
||||
, message_metadata(this, ircd_proto.maxlist)
|
||||
, message_mode(this)
|
||||
, message_nick(this)
|
||||
, message_opertype(this)
|
||||
@@ -2489,12 +2499,6 @@ public:
|
||||
{
|
||||
}
|
||||
|
||||
void OnReload(Configuration::Conf *conf) override
|
||||
{
|
||||
use_server_side_topiclock = conf->GetModule(this)->Get<bool>("use_server_side_topiclock");
|
||||
use_server_side_mlock = conf->GetModule(this)->Get<bool>("use_server_side_mlock");
|
||||
}
|
||||
|
||||
void OnUserNickChange(User *u, const Anope::string &) override
|
||||
{
|
||||
u->RemoveModeInternal(Me, ModeManager::FindUserModeByName("REGISTERED"));
|
||||
@@ -2509,13 +2513,13 @@ public:
|
||||
void OnChanRegistered(ChannelInfo *ci) override
|
||||
{
|
||||
ModeLocks *modelocks = ci->GetExt<ModeLocks>("modelocks");
|
||||
if (use_server_side_mlock && ci->c && modelocks && !modelocks->GetMLockAsString(false).empty())
|
||||
if (ci->c && modelocks && !modelocks->GetMLockAsString(false).empty())
|
||||
{
|
||||
Anope::string modes = modelocks->GetMLockAsString(false).replace_all_cs("+", "").replace_all_cs("-", "");
|
||||
SendChannelMetadata(ci->c, "mlock", modes);
|
||||
}
|
||||
|
||||
if (use_server_side_topiclock && Servers::Capab.count("TOPICLOCK") && ci->c)
|
||||
if (Servers::Capab.count("TOPICLOCK") && ci->c)
|
||||
{
|
||||
if (ci->HasExt("TOPICLOCK"))
|
||||
SendChannelMetadata(ci->c, "topiclock", "1");
|
||||
@@ -2524,10 +2528,11 @@ public:
|
||||
|
||||
void OnDelChan(ChannelInfo *ci) override
|
||||
{
|
||||
if (use_server_side_mlock && ci->c)
|
||||
SendChannelMetadata(ci->c, "mlock", "");
|
||||
if (!ci->c)
|
||||
return;
|
||||
|
||||
if (use_server_side_topiclock && Servers::Capab.count("TOPICLOCK") && ci->c)
|
||||
SendChannelMetadata(ci->c, "mlock", "");
|
||||
if (Servers::Capab.count("TOPICLOCK"))
|
||||
SendChannelMetadata(ci->c, "topiclock", "");
|
||||
}
|
||||
|
||||
@@ -2535,7 +2540,7 @@ public:
|
||||
{
|
||||
ModeLocks *modelocks = ci->GetExt<ModeLocks>("modelocks");
|
||||
ChannelMode *cm = ModeManager::FindChannelModeByName(lock->name);
|
||||
if (use_server_side_mlock && cm && ci->c && modelocks && (cm->type == MODE_REGULAR || cm->type == MODE_PARAM))
|
||||
if (cm && ci->c && modelocks && (cm->type == MODE_REGULAR || cm->type == MODE_PARAM))
|
||||
{
|
||||
Anope::string modes = modelocks->GetMLockAsString(false).replace_all_cs("+", "").replace_all_cs("-", "") + cm->mchar;
|
||||
SendChannelMetadata(ci->c, "mlock", modes);
|
||||
@@ -2548,7 +2553,7 @@ public:
|
||||
{
|
||||
ModeLocks *modelocks = ci->GetExt<ModeLocks>("modelocks");
|
||||
ChannelMode *cm = ModeManager::FindChannelModeByName(lock->name);
|
||||
if (use_server_side_mlock && cm && ci->c && modelocks && (cm->type == MODE_REGULAR || cm->type == MODE_PARAM))
|
||||
if (cm && ci->c && modelocks && (cm->type == MODE_REGULAR || cm->type == MODE_PARAM))
|
||||
{
|
||||
Anope::string modes = modelocks->GetMLockAsString(false).replace_all_cs("+", "").replace_all_cs("-", "").replace_all_cs(cm->mchar, "");
|
||||
SendChannelMetadata(ci->c, "mlock", modes);
|
||||
|
||||
@@ -187,7 +187,15 @@ public:
|
||||
void SendSVSLogin(const Anope::string &uid, NickAlias *na) override
|
||||
{
|
||||
Server *s = Server::Find(uid.substr(0, 3));
|
||||
Uplink::Send("ENCAP", s ? s->GetName() : uid.substr(0, 3), "SVSLOGIN", uid, '*', '*', na->GetVHostHost().empty() ? "*" : na->GetVHostHost(), na->nc->display);
|
||||
Anope::string target = s ? s->GetName() : uid.substr(0, 3);
|
||||
if (na)
|
||||
{
|
||||
Uplink::Send("ENCAP", target, "SVSLOGIN", uid, '*', '*', na->GetVHostHost().empty() ? "*" : na->GetVHostHost(), na->nc->display);
|
||||
}
|
||||
else
|
||||
{
|
||||
Uplink::Send("ENCAP", target, "SU", uid, "");
|
||||
}
|
||||
}
|
||||
|
||||
void SendSVSNOOP(const Server *server, bool set) override
|
||||
|
||||
@@ -45,7 +45,6 @@ public:
|
||||
CanSZLine = true;
|
||||
CanSVSNick = true;
|
||||
CanSVSHold = true;
|
||||
CanSVSLogout = true;
|
||||
CanSetVHost = true;
|
||||
RequiresID = true;
|
||||
MaxModes = 4;
|
||||
@@ -355,8 +354,6 @@ class ProtoSolanum final
|
||||
IRCDMessagePrivmsg message_privmsg;
|
||||
IRCDMessageServer message_server;
|
||||
|
||||
bool use_server_side_mlock;
|
||||
|
||||
static void AddModes()
|
||||
{
|
||||
/* Add user modes */
|
||||
@@ -445,18 +442,13 @@ public:
|
||||
OnUserLogin(u);
|
||||
}
|
||||
|
||||
void OnReload(Configuration::Conf *conf) override
|
||||
{
|
||||
use_server_side_mlock = conf->GetModule(this)->Get<bool>("use_server_side_mlock");
|
||||
}
|
||||
|
||||
void OnChannelSync(Channel *c) override
|
||||
{
|
||||
if (!c->ci)
|
||||
return;
|
||||
|
||||
ModeLocks *modelocks = c->ci->GetExt<ModeLocks>("modelocks");
|
||||
if (use_server_side_mlock && modelocks && Servers::Capab.count("MLOCK") > 0)
|
||||
if (modelocks && Servers::Capab.count("MLOCK") > 0)
|
||||
{
|
||||
Anope::string modes = modelocks->GetMLockAsString(false).replace_all_cs("+", "").replace_all_cs("-", "");
|
||||
Uplink::Send("MLOCK", c->creation_time, c->ci->name, modes);
|
||||
@@ -467,7 +459,7 @@ public:
|
||||
{
|
||||
ModeLocks *modelocks = ci->GetExt<ModeLocks>("modelocks");
|
||||
ChannelMode *cm = ModeManager::FindChannelModeByName(lock->name);
|
||||
if (use_server_side_mlock && cm && ci->c && modelocks && (cm->type == MODE_REGULAR || cm->type == MODE_PARAM) && Servers::Capab.count("MLOCK") > 0)
|
||||
if (cm && ci->c && modelocks && (cm->type == MODE_REGULAR || cm->type == MODE_PARAM) && Servers::Capab.count("MLOCK") > 0)
|
||||
{
|
||||
Anope::string modes = modelocks->GetMLockAsString(false).replace_all_cs("+", "").replace_all_cs("-", "") + cm->mchar;
|
||||
Uplink::Send("MLOCK", ci->c->creation_time, ci->name, modes);
|
||||
@@ -480,7 +472,7 @@ public:
|
||||
{
|
||||
ModeLocks *modelocks = ci->GetExt<ModeLocks>("modelocks");
|
||||
ChannelMode *cm = ModeManager::FindChannelModeByName(lock->name);
|
||||
if (use_server_side_mlock && cm && modelocks && ci->c && (cm->type == MODE_REGULAR || cm->type == MODE_PARAM) && Servers::Capab.count("MLOCK") > 0)
|
||||
if (cm && modelocks && ci->c && (cm->type == MODE_REGULAR || cm->type == MODE_PARAM) && Servers::Capab.count("MLOCK") > 0)
|
||||
{
|
||||
Anope::string modes = modelocks->GetMLockAsString(false).replace_all_cs("+", "").replace_all_cs("-", "").replace_all_cs(cm->mchar, "");
|
||||
Uplink::Send("MLOCK", ci->c->creation_time, ci->name, modes);
|
||||
|
||||
@@ -37,7 +37,6 @@ public:
|
||||
CanSZLine = true;
|
||||
CanSVSHold = true;
|
||||
CanClearBans = true;
|
||||
CanSVSLogout = true;
|
||||
CanCertFP = true;
|
||||
RequiresID = true;
|
||||
MaxModes = 12;
|
||||
@@ -676,24 +675,18 @@ public:
|
||||
/* Borrowed part of this check from UnrealIRCd */
|
||||
bool IsValid(Anope::string &value) const override
|
||||
{
|
||||
if (value.empty() || value[0] == ':')
|
||||
if (value.empty() || value[0] != '[')
|
||||
return false;
|
||||
|
||||
Anope::string rest;
|
||||
auto num1 = Anope::Convert<unsigned>(value[0] == '*' ? value.substr(1) : value, 0, &rest);
|
||||
if (!num1 || rest[0] != ':' || rest.length() <= 1)
|
||||
return false;
|
||||
|
||||
if (Anope::Convert<int>(rest.substr(1), 0, &rest) > 0 && rest.empty())
|
||||
return true;
|
||||
|
||||
/* '['<number><1 letter>[optional: '#'+1 letter],[next..]']'':'<number> */
|
||||
size_t end_bracket = value.find(']', 1);
|
||||
if (end_bracket == Anope::string::npos)
|
||||
return false;
|
||||
|
||||
Anope::string xbuf = value.substr(0, end_bracket);
|
||||
if (value[end_bracket + 1] != ':')
|
||||
return false;
|
||||
|
||||
commasepstream args(xbuf.substr(1));
|
||||
Anope::string arg;
|
||||
while (args.GetToken(arg))
|
||||
@@ -736,8 +729,7 @@ public:
|
||||
// The part after the ':' is a duration and it
|
||||
// can be in the user friendly "1d3h20m" format, make sure we accept that
|
||||
auto n = Anope::DoTime(rest.substr(1));
|
||||
return n <= 0;
|
||||
return false;
|
||||
return n > 0;
|
||||
}
|
||||
};
|
||||
|
||||
@@ -1696,8 +1688,6 @@ class ProtoUnreal final
|
||||
IRCDMessageUID message_uid;
|
||||
IRCDMessageUmode2 message_umode2;
|
||||
|
||||
bool use_server_side_mlock;
|
||||
|
||||
public:
|
||||
ProtoUnreal(const Anope::string &modname, const Anope::string &creator) : Module(modname, creator, PROTOCOL | VENDOR),
|
||||
ircd_proto(this),
|
||||
@@ -1720,11 +1710,6 @@ public:
|
||||
ModuleManager::SetPriority(this, PRIORITY_FIRST);
|
||||
}
|
||||
|
||||
void OnReload(Configuration::Conf *conf) override
|
||||
{
|
||||
use_server_side_mlock = conf->GetModule(this)->Get<bool>("use_server_side_mlock");
|
||||
}
|
||||
|
||||
void OnUserNickChange(User *u, const Anope::string &) override
|
||||
{
|
||||
u->RemoveModeInternal(Me, ModeManager::FindUserModeByName("REGISTERED"));
|
||||
@@ -1738,7 +1723,7 @@ public:
|
||||
return;
|
||||
|
||||
ModeLocks *modelocks = c->ci->GetExt<ModeLocks>("modelocks");
|
||||
if (use_server_side_mlock && Servers::Capab.count("MLOCK") > 0 && modelocks)
|
||||
if (Servers::Capab.count("MLOCK") > 0 && modelocks)
|
||||
{
|
||||
Anope::string modes = modelocks->GetMLockAsString(false).replace_all_cs("+", "").replace_all_cs("-", "");
|
||||
Uplink::Send("MLOCK", c->creation_time, c->ci->name, modes);
|
||||
@@ -1748,7 +1733,7 @@ public:
|
||||
void OnChanRegistered(ChannelInfo *ci) override
|
||||
{
|
||||
ModeLocks *modelocks = ci->GetExt<ModeLocks>("modelocks");
|
||||
if (!ci->c || !use_server_side_mlock || !modelocks || !Servers::Capab.count("MLOCK"))
|
||||
if (!ci->c || !modelocks || !Servers::Capab.count("MLOCK"))
|
||||
return;
|
||||
Anope::string modes = modelocks->GetMLockAsString(false).replace_all_cs("+", "").replace_all_cs("-", "");
|
||||
Uplink::Send("MLOCK", ci->c->creation_time, ci->name, modes);
|
||||
@@ -1756,7 +1741,7 @@ public:
|
||||
|
||||
void OnDelChan(ChannelInfo *ci) override
|
||||
{
|
||||
if (!ci->c || !use_server_side_mlock || !Servers::Capab.count("MLOCK"))
|
||||
if (!ci->c || !Servers::Capab.count("MLOCK"))
|
||||
return;
|
||||
Uplink::Send("MLOCK", ci->c->creation_time, ci->name, "");
|
||||
}
|
||||
@@ -1765,7 +1750,7 @@ public:
|
||||
{
|
||||
ModeLocks *modelocks = ci->GetExt<ModeLocks>("modelocks");
|
||||
ChannelMode *cm = ModeManager::FindChannelModeByName(lock->name);
|
||||
if (use_server_side_mlock && cm && modelocks && ci->c && (cm->type == MODE_REGULAR || cm->type == MODE_PARAM) && Servers::Capab.count("MLOCK") > 0)
|
||||
if (cm && modelocks && ci->c && (cm->type == MODE_REGULAR || cm->type == MODE_PARAM) && Servers::Capab.count("MLOCK") > 0)
|
||||
{
|
||||
Anope::string modes = modelocks->GetMLockAsString(false).replace_all_cs("+", "").replace_all_cs("-", "") + cm->mchar;
|
||||
Uplink::Send("MLOCK", ci->c->creation_time, ci->name, modes);
|
||||
@@ -1778,7 +1763,7 @@ public:
|
||||
{
|
||||
ModeLocks *modelocks = ci->GetExt<ModeLocks>("modelocks");
|
||||
ChannelMode *cm = ModeManager::FindChannelModeByName(lock->name);
|
||||
if (use_server_side_mlock && cm && modelocks && ci->c && (cm->type == MODE_REGULAR || cm->type == MODE_PARAM) && Servers::Capab.count("MLOCK") > 0)
|
||||
if (cm && modelocks && ci->c && (cm->type == MODE_REGULAR || cm->type == MODE_PARAM) && Servers::Capab.count("MLOCK") > 0)
|
||||
{
|
||||
Anope::string modes = modelocks->GetMLockAsString(false).replace_all_cs("+", "").replace_all_cs("-", "").replace_all_cs(cm->mchar, "");
|
||||
Uplink::Send("MLOCK", ci->c->creation_time, ci->name, modes);
|
||||
|
||||
+1
-1
@@ -237,7 +237,7 @@ public:
|
||||
void StartTransaction() override
|
||||
{
|
||||
if (in_transaction)
|
||||
throw CoreException();
|
||||
throw ModuleException("Tried to start a transaction while one was already in progress");
|
||||
|
||||
this->SendCommand(NULL, "MULTI");
|
||||
in_transaction = true;
|
||||
|
||||
@@ -145,14 +145,6 @@ public:
|
||||
|
||||
void ProcessMessage(Session *sess, const SASL::Message &m) override
|
||||
{
|
||||
if (!IRCD->CanSVSLogout && !User::Find(sess->uid))
|
||||
{
|
||||
// This IRCd can't log users out yet.
|
||||
sasl->Fail(sess);
|
||||
delete sess;
|
||||
return;
|
||||
}
|
||||
|
||||
if (m.type == "S")
|
||||
{
|
||||
sasl->SendMessage(sess, "C", "+");
|
||||
|
||||
@@ -103,7 +103,7 @@ bool WebCPanel::NickServ::Info::OnRequest(HTTPProvider *server, const Anope::str
|
||||
replacements["DISPLAY"] = na->nc->display;
|
||||
if (!na->nc->email.empty())
|
||||
replacements["EMAIL"] = na->nc->email;
|
||||
replacements["TIME_REGISTERED"] = Anope::strftime(na->time_registered, na->nc);
|
||||
replacements["TIME_REGISTERED"] = Anope::strftime(na->nc->time_registered, na->nc);
|
||||
if (na->HasVHost())
|
||||
replacements["VHOST"] = na->GetVHostMask();
|
||||
Anope::string *greet = na->nc->GetExt<Anope::string>("greet");
|
||||
|
||||
@@ -26,6 +26,7 @@ CommandSource::CommandSource(const Anope::string &n, User *user, NickCore *core,
|
||||
: nick(n)
|
||||
, u(user)
|
||||
, nc(core)
|
||||
, ip(user ? user->ip.str() : "")
|
||||
, reply(r)
|
||||
, service(bi)
|
||||
, msgid(m)
|
||||
|
||||
+5
-5
@@ -325,8 +325,8 @@ bool Anope::Init(int ac, char **av)
|
||||
Log(LOG_TERMINAL) << "-d, --debug[=level]";
|
||||
Log(LOG_TERMINAL) << "-h, --help";
|
||||
Log(LOG_TERMINAL) << " --localedir=locale directory";
|
||||
Log(LOG_TERMINAL) << " --logdir=logs directory";
|
||||
Log(LOG_TERMINAL) << " --modulesdir=modules directory";
|
||||
Log(LOG_TERMINAL) << " --logdir=log directory";
|
||||
Log(LOG_TERMINAL) << " --moduledir=module directory";
|
||||
Log(LOG_TERMINAL) << "-e, --noexpire";
|
||||
Log(LOG_TERMINAL) << "-n, --nofork";
|
||||
Log(LOG_TERMINAL) << "-p, --nopid";
|
||||
@@ -409,10 +409,10 @@ bool Anope::Init(int ac, char **av)
|
||||
Anope::LocaleDir = arg;
|
||||
}
|
||||
|
||||
if (GetCommandLineArgument("modulesdir", 0, arg))
|
||||
if (GetCommandLineArgument("moduledir", 0, arg))
|
||||
{
|
||||
if (arg.empty())
|
||||
throw CoreException("The --modulesdir option requires a path");
|
||||
throw CoreException("The --moduledir option requires a path");
|
||||
Anope::ModuleDir = arg;
|
||||
}
|
||||
|
||||
@@ -536,7 +536,7 @@ bool Anope::Init(int ac, char **av)
|
||||
|
||||
auto *encryption = ModuleManager::FindFirstOf(ENCRYPTION);
|
||||
if (!encryption)
|
||||
throw CoreException("You must load an encryption module!");
|
||||
throw CoreException("You must load a non-deprecated encryption module!");
|
||||
|
||||
auto *protocol = ModuleManager::FindFirstOf(PROTOCOL);
|
||||
if (!protocol)
|
||||
|
||||
@@ -216,6 +216,9 @@ Serializable *NickAlias::Unserialize(Serializable *obj, Serialize::Data &data)
|
||||
data["extensible:NO_EXPIRE"] >> b;
|
||||
if (b)
|
||||
na->Extend<bool>("NS_NO_EXPIRE");
|
||||
|
||||
if (na->time_registered < na->nc->time_registered)
|
||||
na->nc->time_registered = na->time_registered;
|
||||
/* end compat */
|
||||
|
||||
return na;
|
||||
|
||||
+5
-9
@@ -73,7 +73,9 @@ void NickCore::Serialize(Serialize::Data &data) const
|
||||
data["pass"] << this->pass;
|
||||
data["email"] << this->email;
|
||||
data["language"] << this->language;
|
||||
data["lastmail"] << this->lastmail;
|
||||
data.SetType("lastmail", Serialize::Data::DT_INT); data["lastmail"] << this->lastmail;
|
||||
data.SetType("time_registered", Serialize::Data::DT_INT); data["time_registered"] << this->time_registered;
|
||||
|
||||
data["memomax"] << this->memos.memomax;
|
||||
for (const auto &ignore : this->memos.ignores)
|
||||
data["memoignores"] << ignore << " ";
|
||||
@@ -99,6 +101,7 @@ Serializable *NickCore::Unserialize(Serializable *obj, Serialize::Data &data)
|
||||
data["email"] >> nc->email;
|
||||
data["language"] >> nc->language;
|
||||
data["lastmail"] >> nc->lastmail;
|
||||
data["time_registered"] >> nc->time_registered;
|
||||
data["memomax"] >> nc->memos.memomax;
|
||||
{
|
||||
Anope::string buf;
|
||||
@@ -206,14 +209,7 @@ uint64_t NickCore::GetId()
|
||||
if (this->id)
|
||||
return this->id;
|
||||
|
||||
NickAlias *na = NickAlias::Find(this->display);
|
||||
if (!na)
|
||||
{
|
||||
Log(LOG_DEBUG) << "Unable to find the display NickAlias for NickCore: " << this->display;
|
||||
return 0;
|
||||
}
|
||||
|
||||
Anope::string secretid = this->display + "\0" + Anope::ToString(na->time_registered);
|
||||
Anope::string secretid = this->display + "\0" + Anope::ToString(this->time_registered);
|
||||
|
||||
// Generate the account id. This should almost always only have one
|
||||
// iteration but in the rare case that we generate a duplicate id we try
|
||||
|
||||
+2
-2
@@ -825,14 +825,14 @@ Anope::string User::Mask() const
|
||||
|
||||
bool User::BadPassword()
|
||||
{
|
||||
if (!Config->GetBlock("options")->Get<int>("badpasslimit"))
|
||||
if (!Config->GetBlock("options")->Get<unsigned int>("badpasslimit"))
|
||||
return false;
|
||||
|
||||
if (Config->GetBlock("options")->Get<time_t>("badpasstimeout") > 0 && this->invalid_pw_time > 0 && this->invalid_pw_time < Anope::CurTime - Config->GetBlock("options")->Get<time_t>("badpasstimeout"))
|
||||
this->invalid_pw_count = 0;
|
||||
++this->invalid_pw_count;
|
||||
this->invalid_pw_time = Anope::CurTime;
|
||||
if (this->invalid_pw_count >= Config->GetBlock("options")->Get<int>("badpasslimit"))
|
||||
if (this->invalid_pw_count >= Config->GetBlock("options")->Get<unsigned int>("badpasslimit"))
|
||||
{
|
||||
this->Kill(Me, "Too many invalid passwords");
|
||||
return true;
|
||||
|
||||
+1
-1
@@ -2,5 +2,5 @@
|
||||
|
||||
VERSION_MAJOR=2
|
||||
VERSION_MINOR=1
|
||||
VERSION_PATCH=5
|
||||
VERSION_PATCH=6
|
||||
VERSION_EXTRA=""
|
||||
|
||||
Reference in New Issue
Block a user