From 924141683c866cce33fa43cef2534fa3ccf98401 Mon Sep 17 00:00:00 2001 From: reverse Date: Wed, 19 Aug 2026 01:18:27 +0000 Subject: [PATCH] =?UTF-8?q?extbanbanlist:=20identify=20extbans=20by=20the?= =?UTF-8?q?=20real=20rule=20(:...)=20instead=20of=20"2nd=20byte=20?= =?UTF-8?q?is=20a=20colon"=20=E2=80=94=20the=20old=20heuristic=20wrongly?= =?UTF-8?q?=20skipped=20a=20plain=20hostmask=20whose=20second=20char=20hap?= =?UTF-8?q?pened=20to=20be=20':',=20mis-listing=20it?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/modules/extbanbanlist.rs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/modules/extbanbanlist.rs b/src/modules/extbanbanlist.rs index 35efc3a..30314cf 100644 --- a/src/modules/extbanbanlist.rs +++ b/src/modules/extbanbanlist.rs @@ -10,9 +10,11 @@ use crate::channels::glob_match; use crate::server::Server; use crate::Uid; -/// A plain host-mask ban entry (not itself an extban). +/// A plain host-mask ban entry (not itself an extban). An extban is `:…`, +/// matching `normalize_ban_mask`'s rule — anything else is a plain host-mask. fn is_plain(mask: &str) -> bool { - mask.as_bytes().get(1) != Some(&b':') + let b = mask.as_bytes(); + !(b.len() >= 2 && b[0].is_ascii_alphabetic() && b[1] == b':') } /// True if `uid` is on `chan`'s (plain) ban list with no matching plain exception.