aboutsummaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorGravatar Sadie Powell2025-04-16 12:13:11 +0100
committerGravatar Sadie Powell2025-04-16 12:13:11 +0100
commita3e736de1d3b6423e88b58506c0bfbe89dec3bd3 (patch)
tree04ffa9b7f162c00c5ce4f5da11344ff02622660a /include
parentRefuse to hash passwords using insecure algorithms in MKPASSWD. (diff)
Add <security:banrealmask>.
Diffstat (limited to 'include')
-rw-r--r--include/channels.h4
-rw-r--r--include/configreader.h3
-rw-r--r--include/modules.h4
-rw-r--r--include/modules/extban.h20
4 files changed, 19 insertions, 12 deletions
diff --git a/include/channels.h b/include/channels.h
index 9e6a86656..29ce5267f 100644
--- a/include/channels.h
+++ b/include/channels.h
@@ -288,11 +288,11 @@ public:
* @param user A user to check against the banlist
* @returns True if the user given is banned
*/
- bool IsBanned(User* user);
+ bool IsBanned(User* user, const std::optional<bool>& full = std::nullopt);
/** Check a single ban for match
*/
- bool CheckBan(User* user, const std::string& banmask);
+ bool CheckBan(User* user, const std::string& banmask, const std::optional<bool>& full = std::nullopt);
/** Write a NOTICE to all local users on the channel
* @param text Text to send
diff --git a/include/configreader.h b/include/configreader.h
index ae6a8ea34..2a61906d1 100644
--- a/include/configreader.h
+++ b/include/configreader.h
@@ -490,6 +490,9 @@ public:
/** The maximum number of local connections that can be made to the IRC server. */
size_t SoftLimit;
+ /** Whether to ban the real hostname and IP address of users even if not visible. */
+ bool BanRealMask;
+
/** Whether to store the full nick!duser\@dhost as a list mode setter instead of just their nick. */
bool MaskInList;
diff --git a/include/modules.h b/include/modules.h
index 0b0b628ef..4cd819a92 100644
--- a/include/modules.h
+++ b/include/modules.h
@@ -814,7 +814,7 @@ public:
* @return MOD_RES_DENY to mark as banned, MOD_RES_ALLOW to skip the
* ban check, or MOD_RES_PASSTHRU to check bans normally
*/
- virtual ModResult OnCheckChannelBan(User* user, Channel* chan) ATTR_NOT_NULL(2, 3);
+ virtual ModResult OnCheckChannelBan(User* user, Channel* chan, bool full) ATTR_NOT_NULL(2, 3);
/**
* Checks for a user's match of a single ban
@@ -824,7 +824,7 @@ public:
* @return MOD_RES_DENY to mark as banned, MOD_RES_ALLOW to skip the
* ban check, or MOD_RES_PASSTHRU to check bans normally
*/
- virtual ModResult OnCheckBan(User* user, Channel* chan, const std::string& mask) ATTR_NOT_NULL(2, 3);
+ virtual ModResult OnCheckBan(User* user, Channel* chan, const std::string& mask, bool full) ATTR_NOT_NULL(2, 3);
/** Called before a topic is changed.
* Return 1 to deny the topic change, 0 to check details on the change, -1 to let it through with no checks
diff --git a/include/modules/extban.h b/include/modules/extban.h
index 45b9ebe50..8cdc9f0e8 100644
--- a/include/modules/extban.h
+++ b/include/modules/extban.h
@@ -142,10 +142,11 @@ public:
* @param extban The extban to get the status of.
* @param user The user to match the extban against.
* @param channel The channel which the extban is set on.
+ * @param full Whether to match against hidden data as well as visible data.
* @return MOD_RES_ALLOW if the user is exempted, MOD_RES_DENY if the user is banned, or
* MOD_RES_PASSTHRU if the extban is not set.
*/
- virtual ModResult GetStatus(ActingBase* extban, User* user, Channel* channel) const = 0;
+ virtual ModResult GetStatus(ActingBase* extban, User* user, Channel* channel, const std::optional<bool>& full = std::nullopt) const = 0;
/** Finds an extban by name or letter.
* @param xbname The name or letter of the extban to find.
@@ -239,9 +240,10 @@ public:
* @param user The user to match the text against.
* @param channel The channel which the extban is set on.
* @param text The string to match the user against.
+ * @param full Whether to match against hidden data as well as visible data.
* @return True if the user matches the extban; otherwise, false.
*/
- virtual bool IsMatch(User* user, Channel* channel, const std::string& text) = 0;
+ virtual bool IsMatch(User* user, Channel* channel, const std::string& text, bool full) = 0;
/** @copydoc ServiceProvider::RegisterService */
void RegisterService() override
@@ -293,9 +295,9 @@ public:
Type GetType() const override { return ExtBan::Type::ACTING; }
/** @copydoc ExtBan::Base::IsMatch */
- bool IsMatch(User* user, Channel* channel, const std::string& text) override
+ bool IsMatch(User* user, Channel* channel, const std::string& text, bool full) override
{
- return channel->CheckBan(user, text);
+ return channel->CheckBan(user, text, full);
}
};
@@ -317,15 +319,16 @@ public:
/** Determines whether the specified user matches this acting extban on the specified channel.
* @param user The user to check.
* @param channel The channel to check on.
+ * @param full Whether to match against hidden data as well as visible data.
* @return MOD_RES_ALLOW to explicitly allow their action, MOD_RES_DENY to expicitly deny their
* action, or MOD_RES_PASSTHRU to let the default behaviour apply.
*/
- ModResult GetStatus(User* user, Channel* channel)
+ ModResult GetStatus(User* user, Channel* channel, const std::optional<bool>& full = std::nullopt)
{
if (!GetManager())
return MOD_RES_PASSTHRU;
- return GetManager()->GetStatus(this, user, channel);
+ return GetManager()->GetStatus(this, user, channel, full);
}
};
@@ -349,7 +352,7 @@ public:
Type GetType() const override { return ExtBan::Type::MATCHING; }
/** @copydoc ExtBan::Base::IsMatch */
- virtual bool IsMatch(User* user, Channel* channel, const std::string& text) override = 0;
+ virtual bool IsMatch(User* user, Channel* channel, const std::string& text, bool full) override = 0;
};
/** Provides events relating to extbans. */
@@ -367,8 +370,9 @@ public:
* @param user The user which the extban is being checked against.
* @param chan The channel which the extban is set on.
* @param extban The extban which is being checked against.
+ * @param full Whether to match against hidden data as well as visible data.
*/
- virtual ModResult OnExtBanCheck(User* user, Channel* chan, ExtBan::Base* extban) = 0;
+ virtual ModResult OnExtBanCheck(User* user, Channel* chan, ExtBan::Base* extban, bool full) = 0;
};
inline bool ExtBan::Parse(const std::string& banentry, std::string& name, std::string& value, bool& inverted)