tailscale/cmd/tailscale/cli/ssh_exec.go
mattn d6e7f41151 cmd/tailscale: make ssh command prefer Windows ssh.exe over PATH
use C:\Windows\System32\OpenSSH\ssh.exe (#4933)

Change-Id: Iad73b27b23b746de2c7e994572a54e7e1c370588
Signed-off-by: Yasuhiro Matsumoto <mattn.jp@gmail.com>
(cherry picked from commit 1d04e01d1e62e0f83a24c0e2963c1b74db33c00d)
2022-07-05 09:56:51 -07:00

27 lines
514 B
Go

// Copyright (c) 2022 Tailscale Inc & AUTHORS All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
//go:build !js && !windows
// +build !js,!windows
package cli
import (
"errors"
"os"
"os/exec"
"syscall"
)
func findSSH() (string, error) {
return exec.LookPath("ssh")
}
func execSSH(ssh string, argv []string) error {
if err := syscall.Exec(ssh, argv, os.Environ()); err != nil {
return err
}
return errors.New("unreachable")
}