mirror of
https://github.com/etcd-io/etcd.git
synced 2024-09-27 06:25:44 +00:00
Merge pull request #4534 from mitake/obsolete-comment
etcdserver, auth: remove obsolete mutex
This commit is contained in:
commit
f607f64876
@ -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")
|
||||
|
Loading…
x
Reference in New Issue
Block a user