db: purge all references to a dropped account
All checks were successful
CI / check (push) Successful in 3m45s
All checks were successful
CI / check (push) Successful in 3m45s
Dropping (or expiring) an account left its channel access, channel successorship, and group membership/foundership behind, keyed by name — so re-registering the same nick silently inherited the old privileges. The AccountDropped fold and the live drop_account path now share one helper that erases every reference (founder channels are still handled by handle_account_gone's successor transfer). Closes a privilege-inheritance hole; especially relevant to inactivity expiry.
This commit is contained in:
parent
dc23a44f57
commit
fa55bc3e3a
3 changed files with 74 additions and 1 deletions
|
|
@ -500,6 +500,10 @@ impl Db {
|
|||
}
|
||||
self.log.append(Event::AccountDropped { account: account.to_string() }).map_err(|_| RegError::Internal)?;
|
||||
self.accounts.remove(&k);
|
||||
// Keep live state in step with what the AccountDropped fold does on replay:
|
||||
// erase every reference so a re-registration can't inherit the account's
|
||||
// channel access, successorship, or group standing.
|
||||
super::event::purge_account_refs(account, &mut self.channels, &mut self.grouped, &mut self.net.groups);
|
||||
Ok(true)
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue