safesocket: make ConnectDefault use paths pkg, fixing tailscaled-on-macOS

Signed-off-by: Brad Fitzpatrick <bradfitz@tailscale.com>
This commit is contained in:
Brad Fitzpatrick 2021-02-15 11:19:22 -08:00
parent 7e00100a0a
commit dec01ef22b
2 changed files with 4 additions and 2 deletions

View File

@ -33,7 +33,7 @@ tailscale.com/cmd/tailscale dependencies: (generated by github.com/tailscale/dep
tailscale.com/net/tlsdial from tailscale.com/derp/derphttp
tailscale.com/net/tsaddr from tailscale.com/net/interfaces
💣 tailscale.com/net/tshttpproxy from tailscale.com/derp/derphttp+
tailscale.com/paths from tailscale.com/cmd/tailscale/cli
tailscale.com/paths from tailscale.com/cmd/tailscale/cli+
tailscale.com/safesocket from tailscale.com/cmd/tailscale/cli
💣 tailscale.com/syncs from tailscale.com/net/interfaces+
tailscale.com/tailcfg from tailscale.com/cmd/tailscale/cli+

View File

@ -10,6 +10,8 @@
"errors"
"net"
"runtime"
"tailscale.com/paths"
)
type closeable interface {
@ -31,7 +33,7 @@ func ConnCloseWrite(c net.Conn) error {
// ConnectDefault connects to the local Tailscale daemon.
func ConnectDefault() (net.Conn, error) {
return Connect("/var/run/tailscale/tailscaled.sock", 41112)
return Connect(paths.DefaultTailscaledSocket(), 41112)
}
// Connect connects to either path (on Unix) or the provided localhost port (on Windows).