Recover from dup active profiles that cannot be resolved with username.

This commit is contained in:
Theodor S. Midtlien
2026-09-16 16:00:25 +02:00
committed by GitHub
parent 9d991e9e43
commit 9637cb37e5
6 changed files with 187 additions and 16 deletions
+8
View File
@@ -301,6 +301,14 @@ func (s *Server) Start() error {
}
config, existingConfig, err := s.getConfig(activeProf)
if errors.Is(err, profilemanager.ErrAmbiguousActiveProfile) {
// Running one of the namesakes anyway could connect the machine as
// another users profile, so the daemon comes up on the default
// profile instead of refusing to start.
log.Errorf("starting on the default profile, the active one could not be resolved: %v", err)
activeProf = &profilemanager.ActiveProfileState{ID: profilemanager.DefaultProfileName}
config, existingConfig, err = s.getConfig(activeProf)
}
if err != nil {
log.Errorf("failed to get active profile config: %v", err)