all: illumos/solaris userspace only support
Updates #14565 Change-Id: I743148144938794db0a224873ce76c10dbe6fa5f Signed-off-by: Nahum Shalman <nahamu@gmail.com>
This commit is contained in:
committed by
Brad Fitzpatrick
parent
6ddeae7556
commit
9373a1b902
@@ -4176,7 +4176,7 @@ func (b *LocalBackend) peerAPIServicesLocked() (ret []tailcfg.Service) {
|
||||
})
|
||||
}
|
||||
switch runtime.GOOS {
|
||||
case "linux", "freebsd", "openbsd", "illumos", "darwin", "windows", "android", "ios":
|
||||
case "linux", "freebsd", "openbsd", "illumos", "solaris", "darwin", "windows", "android", "ios":
|
||||
// These are the platforms currently supported by
|
||||
// net/dns/resolver/tsdns.go:Resolver.HandleExitNodeDNSQuery.
|
||||
ret = append(ret, tailcfg.Service{
|
||||
|
||||
@@ -96,7 +96,7 @@ func (a *actor) Username() (string, error) {
|
||||
}
|
||||
defer tok.Close()
|
||||
return tok.Username()
|
||||
case "darwin", "linux":
|
||||
case "darwin", "linux", "illumos", "solaris":
|
||||
uid, ok := a.ci.Creds().UserID()
|
||||
if !ok {
|
||||
return "", errors.New("missing user ID")
|
||||
|
||||
@@ -650,6 +650,8 @@ func osEmoji(os string) string {
|
||||
return "🐡"
|
||||
case "illumos":
|
||||
return "☀️"
|
||||
case "solaris":
|
||||
return "🌤️"
|
||||
}
|
||||
return "👽"
|
||||
}
|
||||
|
||||
@@ -1097,7 +1097,7 @@ func (h *Handler) serveServeConfig(w http.ResponseWriter, r *http.Request) {
|
||||
|
||||
func authorizeServeConfigForGOOSAndUserContext(goos string, configIn *ipn.ServeConfig, h *Handler) error {
|
||||
switch goos {
|
||||
case "windows", "linux", "darwin":
|
||||
case "windows", "linux", "darwin", "illumos", "solaris":
|
||||
default:
|
||||
return nil
|
||||
}
|
||||
@@ -1117,7 +1117,7 @@ func authorizeServeConfigForGOOSAndUserContext(goos string, configIn *ipn.ServeC
|
||||
switch goos {
|
||||
case "windows":
|
||||
return errors.New("must be a Windows local admin to serve a path")
|
||||
case "linux", "darwin":
|
||||
case "linux", "darwin", "illumos", "solaris":
|
||||
return errors.New("must be root, or be an operator and able to run 'sudo tailscale' to serve a path")
|
||||
default:
|
||||
// We filter goos at the start of the func, this default case
|
||||
|
||||
@@ -237,7 +237,7 @@ func TestShouldDenyServeConfigForGOOSAndUserContext(t *testing.T) {
|
||||
}
|
||||
|
||||
for _, tt := range tests {
|
||||
for _, goos := range []string{"linux", "windows", "darwin"} {
|
||||
for _, goos := range []string{"linux", "windows", "darwin", "illumos", "solaris"} {
|
||||
t.Run(goos+"-"+tt.name, func(t *testing.T) {
|
||||
err := authorizeServeConfigForGOOSAndUserContext(goos, tt.configIn, tt.h)
|
||||
gotErr := err != nil
|
||||
|
||||
Reference in New Issue
Block a user