callerid: scrub a departed/renamed nick from ACCEPT lists so it can't be reused to bypass +g

This commit is contained in:
Jean Chevronnet 2026-08-17 14:52:38 +00:00
parent c1b7ed6dda
commit 8ed2003546
2 changed files with 18 additions and 0 deletions

View file

@ -665,6 +665,12 @@ impl Server {
// socket itself once the channel is empty.
if !user.nick.is_empty() {
self.nick_index.remove(&user.nick.to_ascii_lowercase());
// Scrub the departed nick from every +g callerid ACCEPT list, so a new
// user grabbing this nick can't inherit its acceptance and bypass a gate.
let low = user.nick.to_ascii_lowercase();
for u in self.users.values_mut() {
u.accept.retain(|n| n != &low);
}
}
if user.registered {
let line = format!(":{} QUIT :{reason}", user.prefix());