ipn/ipnserver: grant js/wasm all localapi permissions
Updates #3157 Change-Id: I3b63762583a4d655eac33ce3dfda37a1f5135a57 Signed-off-by: Brad Fitzpatrick <bradfitz@tailscale.com>
This commit is contained in:
parent
40e13c316c
commit
87137405e5
|
@ -410,13 +410,16 @@ func (s *Server) checkConnIdentityLocked(ci connIdentity) error {
|
||||||
//
|
//
|
||||||
// s.mu must not be held.
|
// s.mu must not be held.
|
||||||
func (s *Server) localAPIPermissions(ci connIdentity) (read, write bool) {
|
func (s *Server) localAPIPermissions(ci connIdentity) (read, write bool) {
|
||||||
if runtime.GOOS == "windows" {
|
switch runtime.GOOS {
|
||||||
|
case "windows":
|
||||||
s.mu.Lock()
|
s.mu.Lock()
|
||||||
defer s.mu.Unlock()
|
defer s.mu.Unlock()
|
||||||
if s.checkConnIdentityLocked(ci) == nil {
|
if s.checkConnIdentityLocked(ci) == nil {
|
||||||
return true, true
|
return true, true
|
||||||
}
|
}
|
||||||
return false, false
|
return false, false
|
||||||
|
case "js":
|
||||||
|
return true, true
|
||||||
}
|
}
|
||||||
if ci.IsUnixSock {
|
if ci.IsUnixSock {
|
||||||
return true, !isReadonlyConn(ci, s.b.OperatorUserID(), logger.Discard)
|
return true, !isReadonlyConn(ci, s.b.OperatorUserID(), logger.Discard)
|
||||||
|
|
Loading…
Reference in New Issue