-
Notifications
You must be signed in to change notification settings - Fork 1.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
envknob, hostinfo, ipn/ipnlocal: add start of opt-in remote update support #7031
Conversation
8c82b12
to
dcb6744
Compare
Rebased. PTAL. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM! The double opt-in is great from a security perspective 👍
return | ||
} | ||
res.Started = true | ||
defer cmd.Wait() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There might be a race condition here on Windows:
- We start the update process
tailscale.exe
copies itself and kicks off the update processmsiexec
stops this process during the update before theselfCopy
exits(?)- This doesn't return because the process is dead
This seems fairly unlikely, but worth flagging?
return | ||
} | ||
|
||
func findCmdTailscale() (string, error) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is the safe way to do this; not relying on $PATH
but checking the location where everything is expected to be 👍
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Left a comment to that effect lest somebody add a PATH check later.
@@ -77,3 +88,92 @@ func (b *LocalBackend) handleC2N(w http.ResponseWriter, r *http.Request) { | |||
http.Error(w, "unknown c2n path", http.StatusBadRequest) | |||
} | |||
} | |||
|
|||
func (b *LocalBackend) handleC2NUpdate(w http.ResponseWriter, r *http.Request) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thought for the future: we may want some sort of semaphore that prevents two concurrent updates, or if one happened in the past 5 minutes, or something.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added TODO with that text
dcb6744
to
7eda973
Compare
7eda973
to
d1945dd
Compare
…pport Updates #6907 Change-Id: I85db4f6f831dd5ff7a9ef4bfa25902607e0c1558 Signed-off-by: Brad Fitzpatrick <bradfitz@tailscale.com>
d1945dd
to
85f9207
Compare
Updates #6907