From 09720bbd8e3c0d25dfe758cc8d42eb8e82e5b744 Mon Sep 17 00:00:00 2001 From: Jeff Mitchell Date: Mon, 27 Jun 2016 11:17:08 -0400 Subject: [PATCH] Fix picking wrong token lock --- vault/token_store.go | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/vault/token_store.go b/vault/token_store.go index 69af8d3f2..685285a92 100644 --- a/vault/token_store.go +++ b/vault/token_store.go @@ -4,7 +4,6 @@ import ( "encoding/json" "fmt" "regexp" - "strconv" "strings" "sync" "time" @@ -92,8 +91,7 @@ func NewTokenStore(c *Core, config *logical.BackendConfig) (*TokenStore, error) t.tokenLocks = map[string]*sync.RWMutex{} for i := int64(0); i < 256; i++ { - t.tokenLocks[fmt.Sprintf("%2x", - strconv.FormatInt(i, 16))] = &sync.RWMutex{} + t.tokenLocks[fmt.Sprintf("%02x", i)] = &sync.RWMutex{} } t.tokenLocks["custom"] = &sync.RWMutex{}