From fc71f5b1e83a668e402a6b075371e220727ccf11 Mon Sep 17 00:00:00 2001 From: Derek Collison Date: Mon, 8 Feb 2021 15:39:51 -0800 Subject: [PATCH] Account for reload with autosetup Signed-off-by: Derek Collison --- server/reload.go | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/server/reload.go b/server/reload.go index fadfc4e9..ad783b56 100644 --- a/server/reload.go +++ b/server/reload.go @@ -1063,6 +1063,23 @@ func (s *Server) diffOptions(newOpts *Options) ([]option, error) { continue } fallthrough + case "noauthuser": + if oldValue != _EMPTY_ && newValue == _EMPTY_ { + for _, user := range newOpts.Users { + if user.Username == oldValue { + return nil, fmt.Errorf("config reload not supported for %s: old=%v, new=%v", + field.Name, oldValue, newValue) + } + } + } else { + return nil, fmt.Errorf("config reload not supported for %s: old=%v, new=%v", + field.Name, oldValue, newValue) + } + case "systemaccount": + if oldValue != DEFAULT_SYSTEM_ACCOUNT || newValue != _EMPTY_ { + return nil, fmt.Errorf("config reload not supported for %s: old=%v, new=%v", + field.Name, oldValue, newValue) + } default: // TODO(ik): Implement String() on those options to have a nice print. // %v is difficult to figure what's what, %+v print private fields and