mirror of
https://github.com/tailscale/tailscale.git
synced 2025-04-09 01:34:39 +00:00
cmd/tailscale: make ssh command work when tailscaled is built with the ts_include_cli tag
Fixes #12125 Signed-off-by: Sandro Jäckel <sandro.jaeckel@gmail.com>
This commit is contained in:
parent
83808029d8
commit
08a96a86af
@ -84,10 +84,6 @@ func runSSH(ctx context.Context, args []string) error {
|
||||
// of failing. But for now:
|
||||
return fmt.Errorf("no system 'ssh' command found: %w", err)
|
||||
}
|
||||
tailscaleBin, err := os.Executable()
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
knownHostsFile, err := writeKnownHosts(st)
|
||||
if err != nil {
|
||||
return err
|
||||
@ -116,7 +112,9 @@ func runSSH(ctx context.Context, args []string) error {
|
||||
|
||||
argv = append(argv,
|
||||
"-o", fmt.Sprintf("ProxyCommand %q %s nc %%h %%p",
|
||||
tailscaleBin,
|
||||
// os.Executable() would return the real running binary but in case tailscale is built with the ts_include_cli tag,
|
||||
// we need to return the started symlink instead
|
||||
os.Args[0],
|
||||
socketArg,
|
||||
))
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user