From 126f3a640ba9456a369cc0b64923352da7ee9851 Mon Sep 17 00:00:00 2001 From: "Theodor S. Midtlien" Date: Thu, 3 Sep 2026 11:37:26 +0200 Subject: [PATCH] Use sessionholder pointer --- client/server/server.go | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/client/server/server.go b/client/server/server.go index b47499192..96f52f4f4 100644 --- a/client/server/server.go +++ b/client/server/server.go @@ -159,7 +159,7 @@ type Server struct { isLoginRequiredFn func(ctx context.Context) (bool, error) - sessionHolder ipcauth.Identity + sessionHolder *ipcauth.Identity } type oauthAuthFlow struct { @@ -1108,7 +1108,7 @@ func (s *Server) Up(callerCtx context.Context, msg *proto.UpRequest) (*proto.UpR } log.Infof("setting session holder: %d", id.UID) - s.sessionHolder = id + s.sessionHolder = &id s.clientRunning = true s.clientRunningChan = make(chan struct{}) s.clientGiveUpChan = make(chan struct{}) @@ -1358,7 +1358,7 @@ func (s *Server) cleanupConnection() error { // explicitly asked for it. MDM restart does NOT go through this // path, so its clientRunning stays true. s.clientRunning = false - s.sessionHolder = ipcauth.Identity{} + s.sessionHolder = nil // Capture the engine reference before cancelling the context. // After actCancel(), the connectWithRetryRuns goroutine wakes up @@ -2743,10 +2743,10 @@ func (s *Server) authorizeAndPrepareLogin(callerCtx context.Context, msg *proto. func (s *Server) SessionHolder() (ipcauth.Identity, bool) { s.mutex.Lock() defer s.mutex.Unlock() - if !s.clientRunning { + if !s.clientRunning || s.sessionHolder == nil { return ipcauth.Identity{}, false } - return s.sessionHolder, true + return *s.sessionHolder, true } func persistLoginOverrides(activeProf *profilemanager.ActiveProfileState, managementURL string, preSharedKey *string) error {