From a5d110282a864fd2e91b51ce360a977cd0643657 Mon Sep 17 00:00:00 2001 From: Peter Powell Date: Sun, 20 Aug 2017 17:47:38 +0100 Subject: Update wiki links to use HTTPS and point to the correct pages. When we release 3.0 these links will break as they will point to the pages for 3.0 rather than 2.0. --- src/modules/extra/README | 2 +- src/modules/extra/m_mysql.cpp | 2 -- src/modules/m_spanningtree/main.h | 2 +- 3 files changed, 2 insertions(+), 4 deletions(-) (limited to 'src/modules') diff --git a/src/modules/extra/README b/src/modules/extra/README index 2478b57cf..b59494df9 100644 --- a/src/modules/extra/README +++ b/src/modules/extra/README @@ -2,7 +2,7 @@ This directory stores modules which require external libraries to compile. For example, m_filter_pcre requires the PCRE libraries. To compile any of these modules first ensure you have the required dependencies -(read the online documentation at http://wiki.inspircd.org/) and then symlink +(read the online documentation at https://wiki.inspircd.org/) and then symlink the .cpp file from this directory into the parent directory (src/modules/). Alternatively, use the command: ./configure --enable-extras=m_extra.cpp, which will diff --git a/src/modules/extra/m_mysql.cpp b/src/modules/extra/m_mysql.cpp index 01b1553b0..159a0b8b2 100644 --- a/src/modules/extra/m_mysql.cpp +++ b/src/modules/extra/m_mysql.cpp @@ -67,8 +67,6 @@ * 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!) - * - * For a diagram of this system please see http://wiki.inspircd.org/Mysql2 */ class SQLConnection; diff --git a/src/modules/m_spanningtree/main.h b/src/modules/m_spanningtree/main.h index 17adc9287..3e0a83111 100644 --- a/src/modules/m_spanningtree/main.h +++ b/src/modules/m_spanningtree/main.h @@ -31,7 +31,7 @@ * If you completely change the protocol, completely change the number. * * IMPORTANT: If you make changes, document your changes here, without fail: - * http://wiki.inspircd.org/List_of_protocol_changes_between_versions + * https://wiki.inspircd.org/List_of_protocol_changes_between_versions * * Failure to document your protocol changes will result in a painfully * painful death by pain. You have been warned. -- cgit v1.3.1-10-gc9f91 From 7e4cc45149f41346f18e581cb301a1196b92bf68 Mon Sep 17 00:00:00 2001 From: Peter Powell Date: Wed, 18 Oct 2017 00:36:26 +0100 Subject: Fix sending a malformed 410 numeric when sent empty CAP commands. --- src/modules/m_cap.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/modules') diff --git a/src/modules/m_cap.cpp b/src/modules/m_cap.cpp index 6b4387fdd..ae9e824f4 100644 --- a/src/modules/m_cap.cpp +++ b/src/modules/m_cap.cpp @@ -120,7 +120,7 @@ class CommandCAP : public Command } else { - user->WriteNumeric(ERR_INVALIDCAPSUBCOMMAND, "%s %s :Invalid CAP subcommand", user->nick.c_str(), subcommand.c_str()); + user->WriteNumeric(ERR_INVALIDCAPSUBCOMMAND, "%s %s :Invalid CAP subcommand", user->nick.c_str(), subcommand.empty() ? "*" : subcommand.c_str()); return CMD_FAILURE; } -- cgit v1.3.1-10-gc9f91 From 9d4b4344b49de3c474302e8316576b759249c409 Mon Sep 17 00:00:00 2001 From: genius3000 Date: Thu, 27 Jul 2017 03:05:44 -0600 Subject: Inform the client when a SASL message cannot be sent When SASL is properly configured with a 'target' server, we are able to inform the client when the message fails to send. Currently if a target is configured and it is offline, no response is sent. This can cause some clients to time out while waiting for a response. If a target isn't configured, behaviour will not change with this commit. The default of '*' will still send to all servers. Updated example config with 'target' variable. --- docs/conf/modules.conf.example | 7 +++++++ src/modules/m_sasl.cpp | 4 ++++ 2 files changed, 11 insertions(+) (limited to 'src/modules') diff --git a/docs/conf/modules.conf.example b/docs/conf/modules.conf.example index b39ee5d2b..8e193904d 100644 --- a/docs/conf/modules.conf.example +++ b/docs/conf/modules.conf.example @@ -1591,6 +1591,13 @@ # Layer via AUTHENTICATE. Note: You also need to have m_cap.so loaded # for SASL to work. # +# Define the following to your services server name to improve security +# by ensuring the SASL messages are only sent to the services server +# and not to all connected servers. This prevents a rogue server from +# capturing SASL messages. Having this defined can also improve client +# connections when your services are down, as the client will be told +# that SASL failed rather than just timing out on registration. +# #-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-# # Secure list module: Prevent /LIST in the first minute of connection, diff --git a/src/modules/m_sasl.cpp b/src/modules/m_sasl.cpp index 5afab9502..8ac43fba7 100644 --- a/src/modules/m_sasl.cpp +++ b/src/modules/m_sasl.cpp @@ -35,6 +35,10 @@ static void SendSASL(const parameterlist& params) { if (!ServerInstance->PI->SendEncapsulatedData(params)) { + User* u = ServerInstance->FindUUID(params[2]); + if (u) + u->WriteNumeric(904, "%s :SASL authentication failed", u->nick.c_str()); + SASLFallback(NULL, params); } } -- cgit v1.3.1-10-gc9f91 From 3eefb336c670d5b2f39696913717e0c47b75232c Mon Sep 17 00:00:00 2001 From: genius3000 Date: Mon, 21 Nov 2016 22:00:27 -0700 Subject: Improve (synchronize) the notices in m_timedbans * Send to remote servers upon setting * Send to halfop if available upon expiry --- src/modules/m_timedbans.cpp | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) (limited to 'src/modules') diff --git a/src/modules/m_timedbans.cpp b/src/modules/m_timedbans.cpp index 61095d6eb..bbbc518bd 100644 --- a/src/modules/m_timedbans.cpp +++ b/src/modules/m_timedbans.cpp @@ -117,11 +117,13 @@ class CommandTban : public Command T.chan = channel; TimedBanList.push_back(T); + const std::string addban = user->nick + " added a timed ban on " + mask + " lasting for " + ConvToStr(duration) + " seconds."; // If halfop is loaded, send notice to halfops and above, otherwise send to ops and above ModeHandler* mh = ServerInstance->Modes->FindMode('h', MODETYPE_CHANNEL); char pfxchar = (mh && mh->name == "halfop") ? mh->GetPrefix() : '@'; - channel->WriteAllExcept(ServerInstance->FakeClient, true, pfxchar, tmp, "NOTICE %s :%s added a timed ban on %s lasting for %ld seconds.", channel->name.c_str(), user->nick.c_str(), mask.c_str(), duration); + channel->WriteAllExcept(ServerInstance->FakeClient, true, pfxchar, tmp, "NOTICE %s :%s", channel->name.c_str(), addban.c_str()); + ServerInstance->PI->SendChannelNotice(channel, pfxchar, addban); return CMD_SUCCESS; } @@ -207,9 +209,13 @@ class ModuleTimedBans : public Module setban.push_back(mask); CUList empty; - std::string expiry = "*** Timed ban on " + chan + " expired."; - cr->WriteAllExcept(ServerInstance->FakeClient, true, '@', empty, "NOTICE %s :%s", cr->name.c_str(), expiry.c_str()); - ServerInstance->PI->SendChannelNotice(cr, '@', expiry); + const std::string expiry = "*** Timed ban on " + chan + " expired."; + // If halfop is loaded, send notice to halfops and above, otherwise send to ops and above + ModeHandler* mh = ServerInstance->Modes->FindMode('h', MODETYPE_CHANNEL); + char pfxchar = (mh && mh->name == "halfop") ? mh->GetPrefix() : '@'; + + cr->WriteAllExcept(ServerInstance->FakeClient, true, pfxchar, empty, "NOTICE %s :%s", cr->name.c_str(), expiry.c_str()); + ServerInstance->PI->SendChannelNotice(cr, pfxchar, expiry); ServerInstance->SendGlobalMode(setban, ServerInstance->FakeClient); } -- cgit v1.3.1-10-gc9f91 From e83506b7abde9fdd628b9065fb3b6c01d370808f Mon Sep 17 00:00:00 2001 From: Peter Powell Date: Thu, 9 Nov 2017 11:04:52 +0000 Subject: Revert the code changes to m_sasl made in commit 9d4b4344b4. This is causing problems such as duplicate 904 messages. --- src/modules/m_sasl.cpp | 4 ---- 1 file changed, 4 deletions(-) (limited to 'src/modules') diff --git a/src/modules/m_sasl.cpp b/src/modules/m_sasl.cpp index 7108e0c07..0ef93ec5a 100644 --- a/src/modules/m_sasl.cpp +++ b/src/modules/m_sasl.cpp @@ -35,10 +35,6 @@ static void SendSASL(const parameterlist& params) { if (!ServerInstance->PI->SendEncapsulatedData(params)) { - User* u = ServerInstance->FindUUID(params[2]); - if (u) - u->WriteNumeric(904, "%s :SASL authentication failed", u->nick.c_str()); - SASLFallback(NULL, params); } } -- cgit v1.3.1-10-gc9f91 From f57dbb6dbe0a49b0f0aa80c327904d4273a76b55 Mon Sep 17 00:00:00 2001 From: Peter Powell Date: Tue, 7 Nov 2017 18:18:35 +0000 Subject: Work around removing shuns on nicks when the nick is online. --- src/modules/m_shun.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'src/modules') diff --git a/src/modules/m_shun.cpp b/src/modules/m_shun.cpp index 8bf4d30e7..3147d5476 100644 --- a/src/modules/m_shun.cpp +++ b/src/modules/m_shun.cpp @@ -114,13 +114,17 @@ class CommandShun : public Command if (parameters.size() == 1) { - if (ServerInstance->XLines->DelLine(target.c_str(), "SHUN", user)) + if (ServerInstance->XLines->DelLine(parameters[0].c_str(), "SHUN", user)) + { + ServerInstance->SNO->WriteToSnoMask('x', "%s removed SHUN on %s", user->nick.c_str(), parameters[0].c_str()); + } + else if (ServerInstance->XLines->DelLine(target.c_str(), "SHUN", user)) { ServerInstance->SNO->WriteToSnoMask('x',"%s removed SHUN on %s",user->nick.c_str(),target.c_str()); } else { - user->WriteServ("NOTICE %s :*** Shun %s not found in list, try /stats H.",user->nick.c_str(),target.c_str()); + user->WriteServ("NOTICE %s :*** Shun %s not found in list, try /stats H.", user->nick.c_str(), parameters[0].c_str()); return CMD_FAILURE; } } -- cgit v1.3.1-10-gc9f91