diff options
| author | 2021-12-14 16:56:48 +0000 | |
|---|---|---|
| committer | 2021-12-14 16:56:48 +0000 | |
| commit | e9d54724e6cf9ff3772795cf5eed4b259700214f (patch) | |
| tree | c7e06a9ca507df1db4eb5dc2e40a10da8198c086 /src/modules | |
| parent | Revert "Remove support for defaults in find_{compiler,linker}_flags()". (diff) | |
| parent | If a user has a unique username then include it in bans. (diff) | |
Merge branch 'insp3' into master.
Diffstat (limited to 'src/modules')
| -rw-r--r-- | src/modules/extra/m_ldap.cpp | 7 | ||||
| -rw-r--r-- | src/modules/m_anticaps.cpp | 5 | ||||
| -rw-r--r-- | src/modules/m_clearchan.cpp | 2 | ||||
| -rw-r--r-- | src/modules/m_dnsbl.cpp | 12 | ||||
| -rw-r--r-- | src/modules/m_messageflood.cpp | 2 | ||||
| -rw-r--r-- | src/modules/m_repeat.cpp | 2 | ||||
| -rw-r--r-- | src/modules/m_shun.cpp | 2 | ||||
| -rw-r--r-- | src/modules/m_spanningtree/main.cpp | 8 | ||||
| -rw-r--r-- | src/modules/m_spanningtree/main.h | 1 | ||||
| -rw-r--r-- | src/modules/m_spanningtree/netburst.cpp | 3 |
10 files changed, 31 insertions, 13 deletions
diff --git a/src/modules/extra/m_ldap.cpp b/src/modules/extra/m_ldap.cpp index 9eeed4e47..80775d40b 100644 --- a/src/modules/extra/m_ldap.cpp +++ b/src/modules/extra/m_ldap.cpp @@ -20,7 +20,8 @@ * along with this program. If not, see <http://www.gnu.org/licenses/>. */ -/// $LinkerFlags: -llber -lldap_r +/// $LinkerFlags: find_compiler_flags("lber" "") find_compiler_flags("ldap" "") +/// $LinkerFlags: find_linker_flags("lber" "-llber") find_linker_flags("ldap" "-lldap_r") /// $PackageInfo: require_system("arch") libldap /// $PackageInfo: require_system("centos") openldap-devel @@ -30,6 +31,10 @@ #include "inspircd.h" #include "modules/ldap.h" +#if defined LDAP_API_FEATURE_X_OPENLDAP_REENTRANT && !LDAP_API_FEATURE_X_OPENLDAP_REENTRANT +# error InspIRCd requires OpenLDAP to be built as reentrant. +#endif + // Ignore OpenLDAP deprecation warnings on OS X Yosemite and newer. #if defined __APPLE__ # pragma GCC diagnostic push diff --git a/src/modules/m_anticaps.cpp b/src/modules/m_anticaps.cpp index 9972aca32..1f6ff0747 100644 --- a/src/modules/m_anticaps.cpp +++ b/src/modules/m_anticaps.cpp @@ -163,8 +163,9 @@ class ModuleAntiCaps final void CreateBan(Channel* channel, User* user, bool mute) { - std::string banmask(mute ? "m:" : ""); - banmask.append("*!*@"); + std::string banmask(mute ? "m:*!" : "*!"); + banmask.append(user->GetBanIdent()); + banmask.append("@"); banmask.append(user->GetDisplayedHost()); Modes::ChangeList changelist; diff --git a/src/modules/m_clearchan.cpp b/src/modules/m_clearchan.cpp index ee9f5aeaa..ee681dfc7 100644 --- a/src/modules/m_clearchan.cpp +++ b/src/modules/m_clearchan.cpp @@ -119,7 +119,7 @@ class CommandClearChan final XLine* xline; try { - mask = ((method[0] == 'Z') ? curr->GetIPString() : "*@" + curr->GetRealHost()); + mask = (method[0] == 'Z') ? curr->GetIPString() : (curr->GetBanIdent() + "@" + curr->GetRealHost()); xline = xlf->Generate(ServerInstance->Time(), 60*60, user->nick, reason, mask); } catch (ModuleException&) diff --git a/src/modules/m_dnsbl.cpp b/src/modules/m_dnsbl.cpp index a94d53058..203b75518 100644 --- a/src/modules/m_dnsbl.cpp +++ b/src/modules/m_dnsbl.cpp @@ -279,11 +279,11 @@ class DNSBLResolver final case DNSBLEntry::Action::KLINE: { KLine* kl = new KLine(ServerInstance->Time(), ConfEntry->xlineduration, ServerInstance->Config->ServerName.c_str(), reason.c_str(), - "*", them->GetIPString()); + them->GetBanIdent(), them->GetIPString()); if (ServerInstance->XLines->AddLine(kl,NULL)) { - ServerInstance->SNO.WriteToSnoMask('x', "K-line added due to DNSBL match on *@%s to expire in %s (on %s): %s", - them->GetIPString().c_str(), InspIRCd::DurationString(kl->duration).c_str(), + ServerInstance->SNO.WriteToSnoMask('x', "K-line added due to DNSBL match on %s to expire in %s (on %s): %s", + kl->Displayable().c_str(), InspIRCd::DurationString(kl->duration).c_str(), InspIRCd::TimeString(kl->expiry).c_str(), reason.c_str()); ServerInstance->XLines->ApplyLines(); } @@ -297,11 +297,11 @@ class DNSBLResolver final case DNSBLEntry::Action::GLINE: { GLine* gl = new GLine(ServerInstance->Time(), ConfEntry->xlineduration, ServerInstance->Config->ServerName.c_str(), reason.c_str(), - "*", them->GetIPString()); + them->GetBanIdent(), them->GetIPString()); if (ServerInstance->XLines->AddLine(gl,NULL)) { - ServerInstance->SNO.WriteToSnoMask('x', "G-line added due to DNSBL match on *@%s to expire in %s (on %s): %s", - them->GetIPString().c_str(), InspIRCd::DurationString(gl->duration).c_str(), + ServerInstance->SNO.WriteToSnoMask('x', "G-line added due to DNSBL match on %s to expire in %s (on %s): %s", + gl->Displayable().c_str(), InspIRCd::DurationString(gl->duration).c_str(), InspIRCd::TimeString(gl->expiry).c_str(), reason.c_str()); ServerInstance->XLines->ApplyLines(); } diff --git a/src/modules/m_messageflood.cpp b/src/modules/m_messageflood.cpp index 4149e9dc8..5cef63387 100644 --- a/src/modules/m_messageflood.cpp +++ b/src/modules/m_messageflood.cpp @@ -163,7 +163,7 @@ private: if (f->ban) { Modes::ChangeList changelist; - changelist.push_add(*banmode, "*!*@" + user->GetDisplayedHost()); + changelist.push_add(*banmode, "*!" + user->GetBanIdent() + "@" + user->GetDisplayedHost()); ServerInstance->Modes.Process(ServerInstance->FakeClient, dest, nullptr, changelist); } diff --git a/src/modules/m_repeat.cpp b/src/modules/m_repeat.cpp index 8b47d5c4b..b30729ac0 100644 --- a/src/modules/m_repeat.cpp +++ b/src/modules/m_repeat.cpp @@ -407,7 +407,7 @@ class RepeatModule final if (settings->Action == ChannelSettings::ACT_BAN) { Modes::ChangeList changelist; - changelist.push_add(*banmode, "*!*@" + user->GetDisplayedHost()); + changelist.push_add(*banmode, "*!" + user->GetBanIdent() + "@" + user->GetDisplayedHost()); ServerInstance->Modes.Process(ServerInstance->FakeClient, chan, nullptr, changelist); } diff --git a/src/modules/m_shun.cpp b/src/modules/m_shun.cpp index 8f3a7b4fc..d231aae3e 100644 --- a/src/modules/m_shun.cpp +++ b/src/modules/m_shun.cpp @@ -72,7 +72,7 @@ class CommandShun final User *find = ServerInstance->Users.Find(target); if ((find) && (find->registered == REG_ALL)) - target = std::string("*!*@") + find->GetIPString(); + target = "*!" + find->GetBanIdent() + "@" + find->GetIPString(); if (parameters.size() == 1) { diff --git a/src/modules/m_spanningtree/main.cpp b/src/modules/m_spanningtree/main.cpp index ef6ce73ed..93afcd237 100644 --- a/src/modules/m_spanningtree/main.cpp +++ b/src/modules/m_spanningtree/main.cpp @@ -848,6 +848,14 @@ void ModuleSpanningTree::OnShutdown(const std::string& reason) children.front()->SQuit(reason, true); } +void ModuleSpanningTree::OnDecodeMetaData(Extensible* target, const std::string& extname, const std::string& extdata) +{ + // HACK: this should use automatically synced user metadata in v4. + User* dest = static_cast<User*>(target); + if (dest && (extname == "uniqueusername")) + dest->uniqueusername = true; +} + Cullable::Result ModuleSpanningTree::Cull() { if (Utils) diff --git a/src/modules/m_spanningtree/main.h b/src/modules/m_spanningtree/main.h index 417beed7f..3395427aa 100644 --- a/src/modules/m_spanningtree/main.h +++ b/src/modules/m_spanningtree/main.h @@ -206,6 +206,7 @@ class ModuleSpanningTree final ModResult OnAcceptConnection(int newsock, ListenSocket* from, irc::sockets::sockaddrs* client, irc::sockets::sockaddrs* server) override; void OnMode(User* source, User* u, Channel* c, const Modes::ChangeList& modes, ModeParser::ModeProcessFlag processflags) override; void OnShutdown(const std::string& reason) override; + void OnDecodeMetaData(Extensible* target, const std::string& extname, const std::string& extdata) override; Cullable::Result Cull() override; ~ModuleSpanningTree() override; void Prioritize() override; diff --git a/src/modules/m_spanningtree/netburst.cpp b/src/modules/m_spanningtree/netburst.cpp index 3ca58221e..557e05126 100644 --- a/src/modules/m_spanningtree/netburst.cpp +++ b/src/modules/m_spanningtree/netburst.cpp @@ -284,6 +284,9 @@ void TreeSocket::SendUsers(BurstState& bs) if (user->IsAway()) this->WriteLine(CommandAway::Builder(user)); + if (user->uniqueusername) // TODO: convert this to BooleanExtItem in v4. + this->WriteLine(CommandMetadata::Builder(user, "uniqueusername", "1")); + for (const auto& [item, obj] : user->GetExtList()) { const std::string value = item->ToNetwork(user, obj); |
