From ffe6c8e3356c5170ee352c6c38006047d77bf690 Mon Sep 17 00:00:00 2001 From: Brad Fitzpatrick Date: Mon, 26 Apr 2021 11:38:56 -0700 Subject: [PATCH] cmd/tailscale/cli: don't do a simple up when in state NeedsLogin Fixes #1780 Signed-off-by: Brad Fitzpatrick --- cmd/tailscale/cli/up.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/cmd/tailscale/cli/up.go b/cmd/tailscale/cli/up.go index 839d8f275..bdfde2d3c 100644 --- a/cmd/tailscale/cli/up.go +++ b/cmd/tailscale/cli/up.go @@ -329,7 +329,10 @@ func runUp(ctx context.Context, args []string) error { // simpleUp is whether we're running a simple "tailscale up" // to transition to running from a previously-logged-in but // down state, without changing any settings. - simpleUp := len(flagSet) == 0 && curPrefs.Persist != nil && curPrefs.Persist.LoginName != "" + simpleUp := len(flagSet) == 0 && + curPrefs.Persist != nil && + curPrefs.Persist.LoginName != "" && + st.BackendState != ipn.NeedsLogin.String() // At this point we need to subscribe to the IPN bus to watch // for state transitions and possible need to authenticate.