ipn/ipnlocal: preserve b.loginFlags in auto-login cc.Login calls

LocalBackend stores loginFlags at construction so that per-instance
properties (e.g. LoginEphemeral set by tsnet.Server.Ephemeral) persist
for the session. StartLoginInteractiveAs already merges b.loginFlags
into its cc.Login call, but the two auto-login call sites pass bare
controlclient.LoginDefault, silently dropping any stored flags.

Merge b.loginFlags at both auto-login call sites to match the existing
StartLoginInteractiveAs pattern. LoginDefault is zero so this is a
no-op when loginFlags is empty, and restores the documented behavior
when it isn't.

Fixes #15852

Signed-off-by: Scott Graham <scott.github@h4ck3r.net>
This commit is contained in:
Scott Graham
2026-04-17 16:22:18 -07:00
committed by Nick Khyl
parent 618dfd4081
commit cb5a53c424
3 changed files with 61 additions and 2 deletions
+2
View File
@@ -137,6 +137,7 @@ type mockControl struct {
calls []string
authBlocked bool
shutdown chan struct{}
loginFlags controlclient.LoginFlags
hi *tailcfg.Hostinfo
}
@@ -274,6 +275,7 @@ func (cc *mockControl) Login(flags controlclient.LoginFlags) {
cc.mu.Lock()
defer cc.mu.Unlock()
cc.authBlocked = interact || newKeys
cc.loginFlags |= flags
}
func (cc *mockControl) Logout(ctx context.Context) error {