1
0
mirror of https://github.com/unrealircd/unrealircd.git synced 2026-06-12 17:14:46 +02:00

Chanmode +l: when coming from an IRC client, reject <=0 instead of transforming.

Reject it with an ERR_INVALIDMODEPARAM, just like we do for +k.

I think the higher number transforming is fine, but this <=0 transformation
is odd as it almost never is what the user actually intended.

In S2S traffic we still transform, as rejecting there is more problematic,
(causing a desync) and transforming it there is not a major issue, anyway.

Reported by ProgVal in https://bugs.unrealircd.org/view.php?id=6602
This commit is contained in:
Bram Matthys
2026-01-23 08:42:41 +01:00
parent 2dd23d13b7
commit d413959e57
+8 -1
View File
@@ -119,7 +119,14 @@ int cmode_limit_is_ok(Client *client, Channel *channel, char mode, const char *p
} else
if (type == EXCHK_PARAM)
{
/* Actually any value is valid, we just morph it */
/* When coming from an IRC client, we reject limit <=0 explicitly, as it makes no sense */
if (atoi(param) <= 0)
{
sendnumeric(client, ERR_INVALIDMODEPARAM,
channel->name, 'l', param, "Channel limit (+l) needs to be a positive number");
return EX_DENY;
}
/* Any other value is valid, we just morph it */
return EX_ALLOW;
}