rline: native regex engine (thompson nfa, no backtracking) + RLINE regex bans (registration/enforce/stats R/matchonnickchange)
This commit is contained in:
parent
b76fbfdb79
commit
56d3774647
8 changed files with 786 additions and 1 deletions
18
src/ircd.rs
18
src/ircd.rs
|
|
@ -435,6 +435,24 @@ impl Ircd {
|
|||
self.server.remove_user(uid, &reason);
|
||||
return;
|
||||
}
|
||||
// R-line: refuse a user whose nick!user@host realname matches a banned regex
|
||||
// (checked after ident is finalised so the matchtext is the real username).
|
||||
let rl = {
|
||||
let u = &self.server.users[&uid];
|
||||
self.server.matched_rline(
|
||||
&u.nick,
|
||||
&u.ident,
|
||||
&u.host,
|
||||
&u.addr.ip().to_string(),
|
||||
&u.realname,
|
||||
)
|
||||
};
|
||||
if let Some(reason) = rl {
|
||||
self.server
|
||||
.send(uid, format!("ERROR :Closing link: ({reason})"));
|
||||
self.server.remove_user(uid, &reason);
|
||||
return;
|
||||
}
|
||||
// connectclass: verify the class password and apply its on-connect modes
|
||||
if let Some(reason) = crate::modules::connclass::on_register(&mut self.server, uid) {
|
||||
self.server
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue