IsMacSysExt reports whether this binary is the system extension shipped as part of the standalone "System Extension" (a.k.a. "macsys") version of Tailscale for macOS.
()
| 107 | // the standalone "System Extension" (a.k.a. "macsys") version of Tailscale |
| 108 | // for macOS. |
| 109 | func IsMacSysExt() bool { |
| 110 | if runtime.GOOS != "darwin" { |
| 111 | return false |
| 112 | } |
| 113 | return isMacSysExt.Get(func() bool { |
| 114 | if AppIdentifierFn != nil { |
| 115 | return AppIdentifierFn() == macsysExtBundleId |
| 116 | } |
| 117 | |
| 118 | // TODO (barnstar): This check should be redundant once all relevant callers |
| 119 | // use AppIdentifierFn. |
| 120 | exe, err := os.Executable() |
| 121 | if err != nil { |
| 122 | return false |
| 123 | } |
| 124 | return filepath.Base(exe) == macsysExtBundleId |
| 125 | }) |
| 126 | } |
| 127 | |
| 128 | var isMacAppStore lazy.SyncValue[bool] |
| 129 |
no test coverage detected
searching dependent graphs…