OperServ: enforce FORBID EMAIL at registration and SET EMAIL
FORBID accepted and stored EMAIL patterns, but nothing ever checked them: a forbidden address still registered and could be set via NickServ SET EMAIL. Both paths now reject a matching address (new ForbiddenEmail outcome), matching how NICK and CHAN forbids already gate registration.
This commit is contained in:
parent
01ea0fa95e
commit
b749cd2969
4 changed files with 28 additions and 0 deletions
|
|
@ -220,6 +220,12 @@ impl Engine {
|
|||
let Some(creds) = creds else {
|
||||
return reg_reply(&reply, RegOutcome::Internal, account);
|
||||
};
|
||||
// A forbidden email pattern (OperServ FORBID EMAIL) blocks registration.
|
||||
if let Some(addr) = &email {
|
||||
if self.db.is_forbidden("EMAIL", addr).is_some() {
|
||||
return reg_reply(&reply, RegOutcome::ForbiddenEmail, account);
|
||||
}
|
||||
}
|
||||
let addr = email.clone();
|
||||
let outcome = match self.db.register_prepared(account, creds, email) {
|
||||
Ok(()) if self.db.is_verified(account) => RegOutcome::Ok,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue