From 0cf9cde1b437ebe175dffeff5c1a28d29a34c80e Mon Sep 17 00:00:00 2001 From: Hitoshi Mitake Date: Tue, 16 Feb 2016 11:42:29 +0900 Subject: [PATCH] etcdserver, auth: remove obsolete mutex The removed mutex is obsolete because the enabled field is removed in the commit b2d2c79a2fcb20f6c64eeb95d1e7d1ddbcd453b1. --- etcdserver/auth/auth.go | 12 ------------ 1 file changed, 12 deletions(-) diff --git a/etcdserver/auth/auth.go b/etcdserver/auth/auth.go index 3b6f5639b..aa456e2db 100644 --- a/etcdserver/auth/auth.go +++ b/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")