1
0
mirror of https://github.com/unrealircd/unrealircd.git synced 2026-07-10 08:03:13 +02:00

Fix +b ~forward not taking into account +e (ban exemptions).

Reported by rafaelgrether in https://bugs.unrealircd.org/view.php?id=6410
This commit is contained in:
Bram Matthys
2024-05-19 18:49:33 +02:00
parent 229b3a7f1b
commit b07f02fb11
+24 -2
View File
@@ -421,8 +421,30 @@ int link_pre_localjoin_cb(Client *client, Channel *channel, const char *key)
b->banstr = banmask;
if (ban_check_mask(b))
{
safe_free(b);
return link_doforward(client, channel, banchan, LINKTYPE_BAN);
/* Forward ban matched, now check for +e */
Ban *ex = NULL;
for (ex = channel->exlist; ex; ex = ex->next)
{
b->banstr = ex->banstr;
if (ban_check_mask(b))
{
/* except matched, break inner loop */
break;
}
}
if (ex == NULL)
{
/* A ~forward ban matched, go for it.. */
safe_free(b);
return link_doforward(client, channel, banchan, LINKTYPE_BAN);
} else {
/* Break the outer loop as well: the user is exempt,
* so it makes no sense to check other bans anymore.
* no "safe_free(b);" here because that is taken
* care of further down.
*/
break;
}
}
}