mirror of
https://github.com/tailscale/tailscale.git
synced 2025-08-11 21:27:31 +00:00
ipn/ipnlocal: update profile on server sent profile changes
We were not updating the LoginProfile.UserProfile when a netmap updated the UserProfile (e.g. when a node was tagged via the admin panel). Updates #713 Signed-off-by: Maisem Ali <maisem@tailscale.com>
This commit is contained in:
@@ -126,6 +126,7 @@ func (pm *profileManager) SetPrefs(prefsIn ipn.PrefsView) error {
|
||||
up.DisplayName = up.LoginName
|
||||
}
|
||||
cp := pm.currentProfile
|
||||
wasNamedWithLoginName := cp.Name == cp.UserProfile.LoginName
|
||||
if pm.isNewProfile {
|
||||
pm.isNewProfile = false
|
||||
cp.ID, cp.Key = newUnusedID(pm.knownProfiles)
|
||||
@@ -135,6 +136,9 @@ func (pm *profileManager) SetPrefs(prefsIn ipn.PrefsView) error {
|
||||
} else {
|
||||
cp.UserProfile = ps.UserProfile
|
||||
}
|
||||
if wasNamedWithLoginName {
|
||||
cp.Name = ps.LoginName
|
||||
}
|
||||
pm.knownProfiles[cp.ID] = cp
|
||||
if err := pm.writeKnownProfiles(); err != nil {
|
||||
return err
|
||||
|
Reference in New Issue
Block a user