@ -37,16 +37,16 @@ type safesocketDarwin struct {
sameuserproofFD * os . File // file descriptor for macos app store sameuserproof file
sameuserproofFD * os . File // file descriptor for macos app store sameuserproof file
sharedDir string // shared directory for location of sameuserproof file
sharedDir string // shared directory for location of sameuserproof file
checkConn bool // Check macsys safesocket port before returning it
checkConn bool // Check macsys safesocket port before returning it
isMacSysExt func ( ) bool // For testing only to force macsys
isMacSysExt func ( ) bool // For testing only to force macsys
is SandboxedMacos func ( ) bool // For testing only to force macOS sandbox
is MacGUIApp func ( ) bool // For testing only to force macOS sandbox
}
}
var ssd = safesocketDarwin {
var ssd = safesocketDarwin {
isMacSysExt : version . IsMacSysExt ,
isMacSysExt : version . IsMacSysExt ,
is SandboxedMacos: version . IsSandboxedMacOS ,
is MacGUIApp: func ( ) bool { return version . IsMacAppStore ( ) || version . IsMacSysApp ( ) } ,
checkConn : true ,
checkConn : true ,
sharedDir : "/Library/Tailscale" ,
sharedDir : "/Library/Tailscale" ,
}
}
// There are three ways a Darwin binary can be run: as the Mac App Store (macOS)
// There are three ways a Darwin binary can be run: as the Mac App Store (macOS)
@ -68,7 +68,7 @@ func localTCPPortAndTokenDarwin() (port int, token string, err error) {
ssd . mu . Lock ( )
ssd . mu . Lock ( )
defer ssd . mu . Unlock ( )
defer ssd . mu . Unlock ( )
if ! ssd . is SandboxedMacos ( ) {
if ! ssd . is MacGUIApp ( ) {
return 0 , "" , ErrNoTokenOnOS
return 0 , "" , ErrNoTokenOnOS
}
}