tsnet: Default executable name on iOS

When compiled into TailscaleKit.framework (via the libtailscale
repository), os.Executable() returns an error instead of the name of the
executable. This commit adds another branch to the switch statement that
enumerates platforms which behave in this manner, and defaults to
"tsnet" in the same manner as those other platforms.

Fixes #15410.

Signed-off-by: James Nugent <james@jen20.com>
This commit is contained in:
James Nugent 2025-03-21 10:34:16 -04:00 committed by Dave Anderson
parent 5aa1c27aad
commit 75373896c7

View File

@ -505,6 +505,11 @@ func (s *Server) start() (reterr error) {
// directory and hostname when they're not supplied. But we can fall
// back to "tsnet" as well.
exe = "tsnet"
case "ios":
// When compiled as a framework (via TailscaleKit in libtailscale),
// os.Executable() returns an error, so fall back to "tsnet" there
// too.
exe = "tsnet"
default:
return err
}