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

This commit is contained in:
Theodor S. Midtlien
2026-09-16 10:50:56 +02:00
parent f44b6f16ff
commit f011000323
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)