From 217eb258d39b1a1b2c3cb6f137e71055fe845b7e Mon Sep 17 00:00:00 2001 From: James Nugent Date: Fri, 21 Mar 2025 10:34:16 -0400 Subject: [PATCH] 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. Signed-off-by: James Nugent --- tsnet/tsnet.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/tsnet/tsnet.go b/tsnet/tsnet.go index 15cf39cba..1e58b424b 100644 --- a/tsnet/tsnet.go +++ b/tsnet/tsnet.go @@ -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 }