mirror of
https://github.com/tailscale/tailscale.git
synced 2024-11-29 13:05:46 +00:00
cmd/tailscaled: fix state path for windows svc
Signed-off-by: James Tucker <james@tailscale.com>
This commit is contained in:
parent
c163b2a3f1
commit
3f686688a6
@ -158,14 +158,13 @@ func main() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if beWindowsSubprocess() {
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
flag.Parse()
|
flag.Parse()
|
||||||
if flag.NArg() > 0 {
|
if flag.NArg() > 0 {
|
||||||
|
// Windows subprocess is spawned with /subprocess, so we need to avoid this check there.
|
||||||
|
if runtime.GOOS != "windows" || flag.Arg(0) != "/subproc" {
|
||||||
log.Fatalf("tailscaled does not take non-flag arguments: %q", flag.Args())
|
log.Fatalf("tailscaled does not take non-flag arguments: %q", flag.Args())
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if printVersion {
|
if printVersion {
|
||||||
fmt.Println(version.String())
|
fmt.Println(version.String())
|
||||||
@ -193,6 +192,10 @@ func main() {
|
|||||||
args.statepath = paths.DefaultTailscaledStateFile()
|
args.statepath = paths.DefaultTailscaledStateFile()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if beWindowsSubprocess() {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
err := run()
|
err := run()
|
||||||
|
|
||||||
// Remove file sharing from Windows shell (noop in non-windows)
|
// Remove file sharing from Windows shell (noop in non-windows)
|
||||||
|
@ -260,7 +260,7 @@ func startIPNServer(ctx context.Context, logid string) error {
|
|||||||
|
|
||||||
linkMon, err := monitor.New(logf)
|
linkMon, err := monitor.New(logf)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return fmt.Errorf("monitor: %w", err)
|
||||||
}
|
}
|
||||||
dialer := new(tsdial.Dialer)
|
dialer := new(tsdial.Dialer)
|
||||||
|
|
||||||
@ -367,7 +367,7 @@ type engineOrError struct {
|
|||||||
}
|
}
|
||||||
store, err := store.New(logf, statePathOrDefault())
|
store, err := store.New(logf, statePathOrDefault())
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return fmt.Errorf("store: %w", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
ln, _, err := safesocket.Listen(args.socketpath, safesocket.WindowsLocalPort)
|
ln, _, err := safesocket.Listen(args.socketpath, safesocket.WindowsLocalPort)
|
||||||
|
Loading…
Reference in New Issue
Block a user