mirror of
https://github.com/tailscale/tailscale.git
synced 2024-11-29 04:55:31 +00:00
control/controlclient: eliminate race in loginGoal access.
This code is currently racy due to an incorrect assumption that goal is never modified in-place, so does not require extra locking. This change makes the assumption correct. Signed-off-by: Dmytro Shynkevych <dmytro@tailscale.com>
This commit is contained in:
parent
19d77ce6a3
commit
d361511512
@ -355,12 +355,13 @@ func (c *Client) authRoutine() {
|
|||||||
err = fmt.Errorf("weird: server required a new url?")
|
err = fmt.Errorf("weird: server required a new url?")
|
||||||
report(err, "WaitLoginURL")
|
report(err, "WaitLoginURL")
|
||||||
}
|
}
|
||||||
goal.url = url
|
|
||||||
goal.token = nil
|
|
||||||
goal.flags = LoginDefault
|
|
||||||
|
|
||||||
c.mu.Lock()
|
c.mu.Lock()
|
||||||
c.loginGoal = goal
|
c.loginGoal = &LoginGoal{
|
||||||
|
wantLoggedIn: true,
|
||||||
|
flags: LoginDefault,
|
||||||
|
url: url,
|
||||||
|
}
|
||||||
c.state = StateURLVisitRequired
|
c.state = StateURLVisitRequired
|
||||||
c.synced = false
|
c.synced = false
|
||||||
c.mu.Unlock()
|
c.mu.Unlock()
|
||||||
|
Loading…
Reference in New Issue
Block a user