From 9f6e26450b3b30569cb1770a8a15f680e66d47e0 Mon Sep 17 00:00:00 2001 From: Shivaram Lingamneni Date: Mon, 28 Feb 2022 09:59:53 -0500 Subject: [PATCH] make SAREGISTER override DEFCON DEFCON 4 and lower were blocking SAREGISTER. This is wrong; admins should be allowed to make new accounts even under DEFCON (this may be needed specifically to work around the DEFCON restriction). --- irc/accounts.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/irc/accounts.go b/irc/accounts.go index 8b114411..550ebd55 100644 --- a/irc/accounts.go +++ b/irc/accounts.go @@ -356,7 +356,7 @@ func (am *AccountManager) Register(client *Client, account string, callbackNames config := am.server.Config() // final "is registration allowed" check: - if !(config.Accounts.Registration.Enabled || callbackNamespace == "admin") || am.server.Defcon() <= 4 { + if callbackNamespace != "admin" && (!config.Accounts.Registration.Enabled || am.server.Defcon() <= 4) { return errFeatureDisabled }