Fix picking wrong token lock

This commit is contained in:
Jeff Mitchell 2016-06-27 11:17:08 -04:00
parent 185bcb7b48
commit 09720bbd8e
1 changed files with 1 additions and 3 deletions

View File

@ -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{}