CBAN (forbid channel-name globs) + SSLINFO command

This commit is contained in:
Jean Chevronnet 2026-08-09 01:04:33 +00:00
parent cab53016e8
commit 4a53c80d4d
5 changed files with 91 additions and 0 deletions

View file

@ -405,6 +405,17 @@ impl Server {
{
return; // unknown user, or already joined
}
// CBAN — a forbidden channel name (opers bypass)
if !self.users.get(&uid).map(|u| u.flags.oper).unwrap_or(false) {
if let Some(reason) = self.matched_cban(&key) {
self.numeric(
uid,
ERR_BADCHANNEL,
&format!("{name} :Channel is CBAN'd: {reason}"),
);
return;
}
}
// an existing channel can refuse the join (+k / +b / +i / +l)
if let Some(ch) = self.channels.get(&key) {
if let Some(k) = &ch.modes.key {