mirror of
https://github.com/tailscale/tailscale.git
synced 2025-10-09 08:01:31 +00:00
safesocket: remove ConnectionStrategy (#10662)
This type seems to be a migration shim for TCP tailscaled sockets (instead of unix/windows pipes). The `port` field was never set, so it was effectively used as a string (`path` field). Remove the whole type and simplify call sites to pass the socket path directly to `safesocket.Connect`. Updates #cleanup Signed-off-by: Andrew Lytvynov <awly@tailscale.com>
This commit is contained in:
@@ -17,13 +17,13 @@ import (
|
||||
"golang.org/x/sys/windows"
|
||||
)
|
||||
|
||||
func connect(s *ConnectionStrategy) (net.Conn, error) {
|
||||
func connect(path string) (net.Conn, error) {
|
||||
dl := time.Now().Add(20 * time.Second)
|
||||
ctx, cancel := context.WithDeadline(context.Background(), dl)
|
||||
defer cancel()
|
||||
// We use the identification impersonation level so that tailscaled may
|
||||
// obtain information about our token for access control purposes.
|
||||
return winio.DialPipeAccessImpLevel(ctx, s.path, windows.GENERIC_READ|windows.GENERIC_WRITE, winio.PipeImpLevelIdentification)
|
||||
return winio.DialPipeAccessImpLevel(ctx, path, windows.GENERIC_READ|windows.GENERIC_WRITE, winio.PipeImpLevelIdentification)
|
||||
}
|
||||
|
||||
func setFlags(network, address string, c syscall.RawConn) error {
|
||||
|
Reference in New Issue
Block a user