Browse Source

etcdserver, auth: remove obsolete mutex

The removed mutex is obsolete because the enabled field is removed
in the commit b2d2c79a2fcb20f6c64eeb95d1e7d1ddbcd453b1.
Hitoshi Mitake 9 years ago
parent
commit
0cf9cde1b4
1 changed files with 0 additions and 12 deletions
  1. 0 12
      etcdserver/auth/auth.go

+ 0 - 12
etcdserver/auth/auth.go

@@ -23,7 +23,6 @@ import (
 	"reflect"
 	"sort"
 	"strings"
-	"sync"
 	"time"
 
 	"github.com/coreos/etcd/Godeps/_workspace/src/github.com/coreos/pkg/capnslog"
@@ -102,8 +101,6 @@ type store struct {
 	timeout     time.Duration
 	ensuredOnce bool
 
-	mu sync.Mutex // protect enabled
-
 	PasswordStore
 }
 
@@ -409,9 +406,6 @@ func (s *store) UpdateRole(role Role) (Role, error) {
 }
 
 func (s *store) AuthEnabled() bool {
-	s.mu.Lock()
-	defer s.mu.Unlock()
-
 	return s.detectAuth()
 }
 
@@ -420,9 +414,6 @@ func (s *store) EnableAuth() error {
 		return authErr(http.StatusConflict, "already enabled")
 	}
 
-	s.mu.Lock()
-	defer s.mu.Unlock()
-
 	if _, err := s.GetUser("root"); err != nil {
 		return authErr(http.StatusConflict, "No root user available, please create one")
 	}
@@ -448,9 +439,6 @@ func (s *store) DisableAuth() error {
 		return authErr(http.StatusConflict, "already disabled")
 	}
 
-	s.mu.Lock()
-	defer s.mu.Unlock()
-
 	err := s.disableAuth()
 	if err == nil {
 		plog.Noticef("auth: disabled auth")