Skip to content

Commit

Permalink
Address concurrent map read issue
Browse files Browse the repository at this point in the history
  • Loading branch information
vkuznet committed Aug 22, 2024
1 parent fe88e01 commit cfcd15e
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions cric/cric.go
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,8 @@ func UpdateCMSRecords(cricRecords cmsauth.CricRecords) {

// FindUser finds user info in cric records for given cert subject
func FindUser(subjects []string) (cmsauth.CricEntry, error) {
cmsRecordsLock.Lock()
defer cmsRecordsLock.Unlock()
for _, s := range subjects {
s = strings.Replace(s, "CN=", "", -1)
if r, ok := cmsRecords[s]; ok {
Expand Down

0 comments on commit cfcd15e

Please sign in to comment.