Fix +I ~inherit:#chan (invite exceptions)

This commit is contained in:
Bram Matthys 2024-09-09 16:27:23 +02:00
parent 1a2d93778e
commit 10ec67d163
No known key found for this signature in database
GPG key ID: BF8116B163EAAE98
3 changed files with 10 additions and 6 deletions

View file

@ -16,8 +16,8 @@ in progress and may not always be a stable version.
* The maximum number of ~inherit bans in a channel is limited to only
1 by default, see
[set::max-inherit-extended-bans](https://www.unrealircd.org/docs/Set_block#set::max-inherit-extended-bans)
* TODO: This does not work properly yet: This can also be used in `+e` and `+I`, which are counted separately and
have their own limit.
* This can also be used in `+I`, which entries are counted separately and
have their own limit. (TODO: `+e` still needs to be done)
### Changes:
* When retrieving cold or hot patches we now do proper GPG/PGP checks.

View file

@ -895,6 +895,7 @@ int find_invex(Channel *channel, Client *client)
b->client = client;
b->channel = channel;
b->ban_check_types = BANCHK_JOIN;
b->ban_type = EXBTYPE_INVEX;
for (inv = channel->invexlist; inv; inv = inv->next)
{

View file

@ -290,9 +290,8 @@ int extban_inherit_is_banned(BanContext *b)
{
Channel *channel;
BanContext *newctx;
Ban *ret;
int ret = 0;
const char *errmsg = NULL;
int retval;
if (extban_inherit_nested)
return 0;
@ -305,8 +304,12 @@ int extban_inherit_is_banned(BanContext *b)
return 0;
extban_inherit_nested++;
ret = is_banned(b->client, channel, BANCHK_JOIN, NULL, &errmsg);
if (b->ban_type == EXBTYPE_BAN)
ret = is_banned(b->client, channel, BANCHK_JOIN, NULL, &errmsg) ? 1 : 0;
else if (b->ban_type == EXBTYPE_INVEX)
ret = find_invex(channel, b->client);
/* todo: else if (b->ban_type == EXBTYPE_EXCEPT.... */
extban_inherit_nested--;
return ret ? 1 : 0;
return ret;
}