1
0
mirror of https://github.com/anope/anope.git synced 2026-06-12 17:24:49 +02:00

Fix matching stacked extended bans.

This commit is contained in:
Sadie Powell
2026-02-18 17:39:13 +00:00
parent d43acc2381
commit 7242c740c8
4 changed files with 13 additions and 9 deletions
+1 -3
View File
@@ -242,11 +242,9 @@ template<typename T>
class CoreExport ChannelModeVirtual class CoreExport ChannelModeVirtual
: public T : public T
{ {
private:
ChannelMode *basech;
protected: protected:
Anope::string base; Anope::string base;
ChannelMode *basech;
public: public:
ChannelModeVirtual(const Anope::string &mname, const Anope::string &basename); ChannelModeVirtual(const Anope::string &mname, const Anope::string &basename);
+7 -5
View File
@@ -803,7 +803,7 @@ namespace InspIRCdExtBan
} }
}; };
class EntryMatcher final class EntryMatcher
: public Base : public Base
{ {
public: public:
@@ -814,7 +814,9 @@ namespace InspIRCdExtBan
bool Matches(User *u, const Entry *e) override bool Matches(User *u, const Entry *e) override
{ {
return Entry(e->GetMask(), this->name, false).Matches(u); auto mask = e->GetMask();
auto *cm = basech->Unwrap(mask);
return Entry(mask, cm->name, false).Matches(u);
} }
}; };
@@ -914,17 +916,17 @@ namespace InspIRCdExtBan
}; };
class UnidentifiedMatcher final class UnidentifiedMatcher final
: public Base : public EntryMatcher
{ {
public: public:
UnidentifiedMatcher(const Anope::string &mname, const Anope::string &xname, char xchar) UnidentifiedMatcher(const Anope::string &mname, const Anope::string &xname, char xchar)
: Base(mname, xname, xchar) : EntryMatcher(mname, xname, xchar)
{ {
} }
bool Matches(User *u, const Entry *e) override bool Matches(User *u, const Entry *e) override
{ {
return !u->Account() && Entry(e->GetMask(), this->base, false).Matches(u); return !u->Account() && EntryMatcher::Matches(u, e);
} }
}; };
+3 -1
View File
@@ -573,7 +573,9 @@ namespace UnrealExtBan
bool Matches(User *u, const Entry *e) override bool Matches(User *u, const Entry *e) override
{ {
return Entry(e->GetMask(), this->base, false).Matches(u); auto mask = e->GetMask();
auto *cm = basech->Unwrap(mask);
return Entry(mask, cm->name, false).Matches(u);
} }
}; };
+2
View File
@@ -796,6 +796,8 @@ Anope::string Entry::GetCleanMask() const
bool Entry::Matches(User *u, bool full) const bool Entry::Matches(User *u, bool full) const
{ {
Log(LOG_DEBUG) << "Checking whether " << u->GetMask() << " matches " << this->GetMask();
/* First check if this mode has defined any matches (usually for extbans). */ /* First check if this mode has defined any matches (usually for extbans). */
if (IRCD->IsExtbanValid(this->mask)) if (IRCD->IsExtbanValid(this->mask))
{ {